[llvm-commits] [llvm] r149175 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/variables-invalid.s
Rafael Espindola
rafael.espindola at gmail.com
Fri Jan 27 22:22:15 PST 2012
Author: rafael
Date: Sat Jan 28 00:22:14 2012
New Revision: 149175
URL: http://llvm.org/viewvc/llvm-project?rev=149175&view=rev
Log:
Small improvement to the recursion detection logic from the previous commit.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/variables-invalid.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=149175&r1=149174&r2=149175&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sat Jan 28 00:22:14 2012
@@ -1565,7 +1565,9 @@
return false;
case MCExpr::SymbolRef: {
const MCSymbol &S = static_cast<const MCSymbolRefExpr*>(Value)->getSymbol();
- return &S.AliasedSymbol() == Sym;
+ if (S.isVariable())
+ return IsUsedIn(Sym, S.getVariableValue());
+ return &S == Sym;
}
case MCExpr::Unary:
return IsUsedIn(Sym, static_cast<const MCUnaryExpr*>(Value)->getSubExpr());
Modified: llvm/trunk/test/MC/AsmParser/variables-invalid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/variables-invalid.s?rev=149175&r1=149174&r2=149175&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/variables-invalid.s (original)
+++ llvm/trunk/test/MC/AsmParser/variables-invalid.s Sat Jan 28 00:22:14 2012
@@ -21,3 +21,7 @@
t4_s0 = t4_s1
t4_s1 = t4_s2
t4_s2 = t4_s0
+
+// CHECK: Recursive use of 't5_s1'
+ t5_s0 = t5_s1 + 1
+ t5_s1 = t5_s0
More information about the llvm-commits
mailing list