summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-02-10 15:13:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-02-10 15:13:12 +0000
commitbe99157127994212eba77f268d508526fed177fd (patch)
treec8355d695265a35731d28a720b14a2bd8787ec3f /llvm/lib/MC/MCParser/AsmParser.cpp
parent01496fe4557dc3eea9f58eedad2bb1dd1bacd796 (diff)
downloadbcm5719-llvm-be99157127994212eba77f268d508526fed177fd.tar.gz
bcm5719-llvm-be99157127994212eba77f268d508526fed177fd.zip
Move some error handling down to MCStreamer.
This makes sure we get the same redefinition rules regardless of who is printing (asm parser, codegen) and to what (asm, obj). This fixes an unintentional regression in r293936. llvm-svn: 294752
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index a8497092448..33843d7cbed 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1630,12 +1630,6 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
Sym = getContext().getOrCreateSymbol(IDVal);
} else
Sym = Ctx.createDirectionalLocalSymbol(LocalLabelVal);
-
- Sym->redefineIfPossible();
-
- if (!Sym->isUndefined() || Sym->isVariable())
- return Error(IDLoc, "invalid symbol redefinition");
-
// End of Labels should be treated as end of line for lexing
// purposes but that information is not available to the Lexer who
// does not understand Labels. This may cause us to see a Hash
@@ -1654,7 +1648,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
// Emit the label.
if (!ParsingInlineAsm)
- Out.EmitLabel(Sym);
+ Out.EmitLabel(Sym, IDLoc);
// If we are generating dwarf for assembly source files then gather the
// info to make a dwarf label entry for this label if needed.
OpenPOWER on IntegriCloud