diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2011-04-29 18:20:17 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2011-04-29 18:20:17 +0000 |
| commit | bea7b93c884412b61a068dc459027089d9764e7e (patch) | |
| tree | 56d156f34f22355fc82bad2115ae681a6131506a /llvm/lib | |
| parent | b200f93125eb019d69c220fa447faea4f5d4eb8a (diff) | |
| download | bcm5719-llvm-bea7b93c884412b61a068dc459027089d9764e7e.tar.gz bcm5719-llvm-bea7b93c884412b61a068dc459027089d9764e7e.zip | |
MC: Change variable symbols to be recognized as defined, by assigning their sections based on FindAssociatedSection().
llvm-svn: 130523
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCSymbol.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp index 1c71f267a4b..c2fad1674aa 100644 --- a/llvm/lib/MC/MCSymbol.cpp +++ b/llvm/lib/MC/MCSymbol.cpp @@ -58,9 +58,13 @@ void MCSymbol::setVariableValue(const MCExpr *Value) { "Invalid redefinition!"); this->Value = Value; - // Mark the variable as absolute as appropriate. - if (isa<MCConstantExpr>(Value)) - setAbsolute(); + // Variables should always be marked as in the same "section" as the value. + const MCSection *Section = Value->FindAssociatedSection(); + if (Section) { + setSection(*Section); + } else { + setUndefined(); + } } void MCSymbol::print(raw_ostream &OS) const { |

