summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
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
commit1283317db47cdec313361137e2098d3e0eb8771c (patch)
tree56e360128d49e764c5649ab3b7e2b68fb9fa4663 /llvm/lib/MC/MCParser
parent765a6e02319e67263d9002581e6eb37de2a5aec5 (diff)
downloadbcm5719-llvm-1283317db47cdec313361137e2098d3e0eb8771c.tar.gz
bcm5719-llvm-1283317db47cdec313361137e2098d3e0eb8771c.zip
Assembler should accept redefinitions of unused variable symbols.
rdar://11027851 llvm-svn: 153137
Diffstat (limited to 'llvm/lib/MC/MCParser')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 41ad1642d28..ab5ddaf4ac0 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/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())
OpenPOWER on IntegriCloud