From db9835d0895337eb94c19e3a30b7d3fc8fcddfd5 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119144 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCSymbol.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/MC/MCSymbol.cpp') diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 07751f7..ebd3144 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(Value))) && "Invalid redefinition!"); -- cgit v1.1