diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-28 07:08:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-28 07:08:35 +0000 |
commit | 8f4d146c340c9423271ebd7bb3fd32b880000bc9 (patch) | |
tree | 30e828d8e7786804767d1d4b326d6525068b0edf /include/llvm/MC/MCAssembler.h | |
parent | d17479e8458d17575e2532d9e8a61057b057a33d (diff) | |
download | external_llvm-8f4d146c340c9423271ebd7bb3fd32b880000bc9.zip external_llvm-8f4d146c340c9423271ebd7bb3fd32b880000bc9.tar.gz external_llvm-8f4d146c340c9423271ebd7bb3fd32b880000bc9.tar.bz2 |
llvm-mc: Support .comm emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCAssembler.h')
-rw-r--r-- | include/llvm/MC/MCAssembler.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 4b66159..182d2fe 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -452,6 +452,17 @@ public: /// 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; + + /// 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; @@ -485,7 +496,31 @@ public: 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; + } + + /// getCommonAlignment - Return the alignment of a 'common' symbol. + unsigned getCommonAlignment() const { + assert(isCommon() && "Not a 'common' symbol!"); + return CommonAlign; + } + /// getFlags - Get the (implementation defined) symbol flags. uint32_t getFlags() const { return Flags; } |