- /// IsExternal - True if this symbol is visible outside this translation
- /// unit.
- unsigned IsExternal : 1;
-
- /// IsPrivateExtern - True if this symbol is private extern.
- unsigned IsPrivateExtern : 1;
-
- /// CommonSize - The size of the symbol, if it is 'common', or 0.
- //
- // FIXME: Pack this in with other fields? We could put it in offset, since a
- // common symbol can never get a definition.
- uint64_t CommonSize;
-
- /// SymbolSize - An expression describing how to calculate the size of
- /// a symbol. If a symbol has no size this field will be NULL.
- const MCExpr *SymbolSize;
-
- /// CommonAlign - The alignment of the symbol, if it is 'common'.
- //
- // FIXME: Pack this in with other fields?
- unsigned CommonAlign;
-
- /// Flags - The Flags field is used by object file implementations to store
- /// additional per symbol information which is not easily classified.
- uint32_t Flags;
-
- /// Index - Index field, for use by the object file implementation.
- uint64_t Index;
-
-public:
- // Only for use as sentinel.
- MCSymbolData();
- MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
- MCAssembler *A = 0);
-
- /// @name Accessors
- /// @{
-
- const MCSymbol &getSymbol() const { return *Symbol; }
-
- MCFragment *getFragment() const { return Fragment; }
- void setFragment(MCFragment *Value) { Fragment = Value; }
-
- uint64_t getOffset() const { return Offset; }
- void setOffset(uint64_t Value) { Offset = Value; }
-
- /// @}
- /// @name Symbol Attributes
- /// @{
-
- bool isExternal() const { return IsExternal; }
- void setExternal(bool Value) { IsExternal = Value; }
-
- bool isPrivateExtern() const { return IsPrivateExtern; }
- void setPrivateExtern(bool Value) { IsPrivateExtern = Value; }
-
- /// isCommon - Is this a 'common' symbol.
- bool isCommon() const { return CommonSize != 0; }
-
- /// setCommon - Mark this symbol as being 'common'.
- ///
- /// \param Size - The size of the symbol.
- /// \param Align - The alignment of the symbol.
- void setCommon(uint64_t Size, unsigned Align) {
- CommonSize = Size;
- CommonAlign = Align;
- }
-
- /// getCommonSize - Return the size of a 'common' symbol.
- uint64_t getCommonSize() const {
- assert(isCommon() && "Not a 'common' symbol!");
- return CommonSize;
- }
-
- void setSize(const MCExpr *SS) {
- SymbolSize = SS;
- }
-
- const MCExpr *getSize() const {
- return SymbolSize;
- }
-
-
- /// getCommonAlignment - Return the alignment of a 'common' symbol.
- unsigned getCommonAlignment() const {
- assert(isCommon() && "Not a 'common' symbol!");
- return CommonAlign;