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 | 90604ab725da8a2a57cf3ca1541b14b95d619040 (patch) | |
tree | 043e57a0fb1341dc8afb3f3b5ebf029021a70def /lib/MC/MCSymbol.cpp | |
parent | 173aa9ce3207379f9d9b18bdb9aefb0de1da8c85 (diff) | |
download | external_llvm-90604ab725da8a2a57cf3ca1541b14b95d619040.zip external_llvm-90604ab725da8a2a57cf3ca1541b14b95d619040.tar.gz external_llvm-90604ab725da8a2a57cf3ca1541b14b95d619040.tar.bz2 |
MC: Change variable symbols to be recognized as defined, by assigning their sections based on FindAssociatedSection().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCSymbol.cpp')
-rw-r--r-- | lib/MC/MCSymbol.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 1c71f26..c2fad167 100644 --- a/lib/MC/MCSymbol.cpp +++ b/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 { |