summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCSymbol.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-11-15 14:40:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-11-15 14:40:36 +0000
commit46c79ef1132607aead144dfda0f26aa8b065214f (patch)
tree1805010ca6b1bca73a1e7fc41f1ff833b53139fd /llvm/lib/MC/MCSymbol.cpp
parent99da11cf0474ea6ef1ea73acbe9bfd9847b61451 (diff)
downloadbcm5719-llvm-46c79ef1132607aead144dfda0f26aa8b065214f.tar.gz
bcm5719-llvm-46c79ef1132607aead144dfda0f26aa8b065214f.zip
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. llvm-svn: 119144
Diffstat (limited to 'llvm/lib/MC/MCSymbol.cpp')
-rw-r--r--llvm/lib/MC/MCSymbol.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp
index 07751f72984..ebd3144a153 100644
--- a/llvm/lib/MC/MCSymbol.cpp
+++ b/llvm/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!");
OpenPOWER on IntegriCloud