summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/MC/MCAssembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/MC/MCAssembler.h')
-rw-r--r--llvm/include/llvm/MC/MCAssembler.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index b5ee5017cc9..ce9dca1ae12 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -39,6 +39,9 @@ public:
private:
FragmentType Kind;
+ /// Parent - The data for the section this fragment is in.
+ MCSectionData *Parent;
+
/// @name Assembler Backend Data
/// @{
//
@@ -54,7 +57,7 @@ private:
/// @}
protected:
- MCFragment(FragmentType _Kind, MCSectionData *SD = 0);
+ MCFragment(FragmentType _Kind, MCSectionData *_Parent = 0);
public:
// Only for sentinel.
@@ -63,6 +66,9 @@ public:
FragmentType getKind() const { return Kind; }
+ MCSectionData *getParent() const { return Parent; }
+ void setParent(MCSectionData *Value) { Parent = Value; }
+
// FIXME: This should be abstract, fix sentinel.
virtual uint64_t getMaxFileSize() const {
assert(0 && "Invalid getMaxFileSize call!");
@@ -74,6 +80,8 @@ public:
//
// FIXME: This could all be kept private to the assembler implementation.
+ uint64_t getAddress() const;
+
unsigned getFileSize() const {
assert(FileSize != ~UINT64_C(0) && "File size not set!");
return FileSize;
@@ -255,6 +263,10 @@ private:
//
// FIXME: This could all be kept private to the assembler implementation.
+ /// Address - The computed address of this section. This is ~0 until
+ /// initialized.
+ uint64_t Address;
+
/// FileSize - The size of this section in the object file. This is ~0 until
/// initialized.
uint64_t FileSize;
@@ -293,6 +305,12 @@ public:
//
// FIXME: This could all be kept private to the assembler implementation.
+ unsigned getAddress() const {
+ assert(Address != ~UINT64_C(0) && "Address not set!");
+ return Address;
+ }
+ void setAddress(uint64_t Value) { Address = Value; }
+
unsigned getFileSize() const {
assert(FileSize != ~UINT64_C(0) && "File size not set!");
return FileSize;
OpenPOWER on IntegriCloud