aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2021-03-09 10:54:41 +0000
committerJohn Brawn <john.brawn@arm.com>2021-03-09 10:54:41 +0000
commitbf3a27196085e4fbfdb7095539a4d030a568aee7 (patch)
treeca9a621c1e08cf546db6225a4950fbaea6404bde /llvm/lib/MC/MCStreamer.cpp
parent373e1681c970d7e7462164defb98098b7bc79946 (diff)
downloadllvm-bf3a27196085e4fbfdb7095539a4d030a568aee7.zip
llvm-bf3a27196085e4fbfdb7095539a4d030a568aee7.tar.gz
llvm-bf3a27196085e4fbfdb7095539a4d030a568aee7.tar.bz2
[CodeGen] Report a normal instead of fatal error for label redefinition
A symbol being redefined as a label is something that can happen as a result of ordinary input, so it shouldn't cause a fatal error. Also adjust the error message to match the one you get when a symbol is redefined as a variable. Differential Revision: https://reviews.llvm.org/D98181
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index ee4cce0..997cebf 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -415,7 +415,8 @@ void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
Symbol->redefineIfPossible();
if (!Symbol->isUndefined() || Symbol->isVariable())
- return getContext().reportError(Loc, "invalid symbol redefinition");
+ return getContext().reportError(Loc, "symbol '" + Twine(Symbol->getName()) +
+ "' is already defined");
assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
assert(getCurrentSectionOnly() && "Cannot emit before setting section!");