diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-15 14:40:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-15 14:40:36 +0000 |
commit | db9835d0895337eb94c19e3a30b7d3fc8fcddfd5 (patch) | |
tree | 44c7e159de2a82428c8280b8a1c08c1b68188b60 /lib/MC/MCSymbol.cpp | |
parent | 38e0c9ba578bb1f2871fa3f15c9a97a83cc17c82 (diff) |
Fix PR8565.
This moves most of the isUsed logic to the MCSymbol itself. With this we
get a bit more relaxed about allowing definitions after uses: uses that
don't evaluate their argument immediately (jmp foo) are accepted.
ddunbar, this was the smallest compromise I could think of that lets us
accept gcc (and clang!) assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCSymbol.cpp')
-rw-r--r-- | lib/MC/MCSymbol.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 07751f7298..ebd3144a15 100644 --- a/lib/MC/MCSymbol.cpp +++ b/lib/MC/MCSymbol.cpp @@ -40,6 +40,7 @@ static bool NameNeedsQuoting(StringRef Str) { } void MCSymbol::setVariableValue(const MCExpr *Value) { + assert(!IsUsed && "Cannot set a variable that has already been used."); assert(Value && "Invalid variable value!"); assert((isUndefined() || (isAbsolute() && isa<MCConstantExpr>(Value))) && "Invalid redefinition!"); |