diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-06-22 19:57:33 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-06-22 19:57:33 +0000 |
commit | 63b4dc46ca636b0db2592b352afa98e0f1f8fea2 (patch) | |
tree | e32015c95bdc419436f2b74dff9c9c8bda5bc612 /llvm/lib/MC/MCSymbol.cpp | |
parent | 617f5ccb5ce241093e4efc23e71bffcf11d383fc (diff) | |
download | bcm5719-llvm-63b4dc46ca636b0db2592b352afa98e0f1f8fea2.tar.gz bcm5719-llvm-63b4dc46ca636b0db2592b352afa98e0f1f8fea2.zip |
Move MCSymbol Value in to the union of Offset and CommonSize.
This is a reapplication of r239440 which was reverted in r239441.
There are no changes to this patch from then, but this had instead exposed
a bug in .thumb_set which was fixed in r240318. Having fixed that bug, it
is now safe to re-apply this code.
Original commit message below:
It wasn't possible to have a variable Symbol with offset or 'isCommon' so
this just enables better packing of the MCSymbol class.
Reviewed by Rafael Espindola.
llvm-svn: 240320
Diffstat (limited to 'llvm/lib/MC/MCSymbol.cpp')
-rw-r--r-- | llvm/lib/MC/MCSymbol.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp index 44842213280..bbd34f15740 100644 --- a/llvm/lib/MC/MCSymbol.cpp +++ b/llvm/lib/MC/MCSymbol.cpp @@ -40,7 +40,11 @@ void *MCSymbol::operator new(size_t s, const StringMapEntry<bool> *Name, void MCSymbol::setVariableValue(const MCExpr *Value) { assert(!IsUsed && "Cannot set a variable that has already been used."); assert(Value && "Invalid variable value!"); + assert((SymbolContents == SymContentsUnset || + SymbolContents == SymContentsVariable) && + "Cannot give common/offset symbol a variable value"); this->Value = Value; + SymbolContents = SymContentsVariable; SectionOrFragment = nullptr; } |