From 46c79ef1132607aead144dfda0f26aa8b065214f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 15 Nov 2010 14:40:36 +0000 Subject: 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 --- llvm/lib/MC/MCSymbol.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/MC/MCSymbol.cpp') 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(Value))) && "Invalid redefinition!"); -- cgit v1.2.3