Skip to content

Commit 1635dea

Browse files
committed
[AsmPrinter] Replace a reachable report_fatal_error with MCContext::reportError
1 parent 8ffda23 commit 1635dea

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
534534

535535
GVSym->redefineIfPossible();
536536
if (GVSym->isDefined() || GVSym->isVariable())
537-
report_fatal_error("symbol '" + Twine(GVSym->getName()) +
538-
"' is already defined");
537+
OutContext.reportError(SMLoc(), "symbol '" + Twine(GVSym->getName()) +
538+
"' is already defined");
539539

540540
if (MAI->hasDotTypeDotSizeDirective())
541541
OutStreamer->emitSymbolAttribute(EmittedSym, MCSA_ELF_TypeObject);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
; RUN: not --crash llc < %s 2>&1 | FileCheck %s
1+
; RUN: not llc -filetype=null %s 2>&1 | FileCheck %s
22
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33
target triple = "x86_64-unknown-linux-gnu"
44

55
module asm ".equiv var, __var"
66

77
@var = global i32 0
8-
; CHECK: symbol 'var' is already defined
8+
; CHECK: <unknown>:0: error: symbol 'var' is already defined
9+
; CHECK: <unknown>:0: error: invalid symbol redefinition

0 commit comments

Comments
 (0)