aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-03-20 21:33:21 +0000
committerJim Grosbach <grosbach@apple.com>2012-03-20 21:33:21 +0000
commit48c9533181ec7ef24e49a4f5bca9151dc6886bad (patch)
tree7e8ccd80330d37eecac5967c986746c9563e13c2 /lib/MC/MCParser/AsmParser.cpp
parent93a1a0dbda3e5e449a6b498f753130d0c240cacd (diff)
Assembler should accept redefinitions of unused variable symbols.
rdar://11027851 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 41ad1642d2..ab5ddaf4ac 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -1629,6 +1629,8 @@ bool AsmParser::ParseAssignment(StringRef Name, bool allow_redef) {
return Error(EqualLoc, "Recursive use of '" + Name + "'");
else if (Sym->isUndefined() && !Sym->isUsed() && !Sym->isVariable())
; // Allow redefinitions of undefined symbols only used in directives.
+ else if (Sym->isVariable() && !Sym->isUsed() && allow_redef)
+ ; // Allow redefinitions of variables that haven't yet been used.
else if (!Sym->isUndefined() && (!Sym->isVariable() || !allow_redef))
return Error(EqualLoc, "redefinition of '" + Name + "'");
else if (!Sym->isVariable())