1 //===- MCAsmLayout.h - Assembly Layout Object -------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCASMLAYOUT_H
11 #define LLVM_MC_MCASMLAYOUT_H
19 /// Encapsulates the layout of an assembly file at a particular point in time.
21 /// Assembly may requiring compute multiple layouts for a particular assembly
22 /// file as part of the relaxation process. This class encapsulates the layout
23 /// at a single point in time in such a way that it is always possible to
24 /// efficiently compute the exact addresses of any symbol in the assembly file,
25 /// even during the relaxation process.
28 MCAssembler &Assembler;
31 MCAsmLayout(MCAssembler &_Assembler) : Assembler(_Assembler) {}
33 /// Get the assembler object this is a layout for.
34 MCAssembler &getAssembler() const { return Assembler; }
36 uint64_t getFragmentAddress(const MCFragment *F) const;
38 uint64_t getFragmentEffectiveSize(const MCFragment *F) const;
39 void setFragmentEffectiveSize(MCFragment *F, uint64_t Value);
41 uint64_t getFragmentOffset(const MCFragment *F) const;
42 void setFragmentOffset(MCFragment *F, uint64_t Value);
44 uint64_t getSectionAddress(const MCSectionData *SD) const;
46 uint64_t getSymbolAddress(const MCSymbolData *SD) const;
48 void setSectionAddress(MCSectionData *SD, uint64_t Value);
51 } // end namespace llvm