diff options
author | John Brawn <john.brawn@arm.com> | 2021-03-09 10:54:41 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2021-03-09 10:54:41 +0000 |
commit | bf3a27196085e4fbfdb7095539a4d030a568aee7 (patch) | |
tree | ca9a621c1e08cf546db6225a4950fbaea6404bde /llvm/lib/MC/MCStreamer.cpp | |
parent | 373e1681c970d7e7462164defb98098b7bc79946 (diff) | |
download | llvm-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.cpp | 3 |
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!"); |