diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-04 18:51:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-04 18:51:09 +0000 |
commit | 23922873066c22cdf5c06b2ceb5cd2d75846ecb6 (patch) | |
tree | 5522a2b535f35082548d4f4895609b4e7cb69255 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | afa3c0a875e0cb2968e8fffd3e23a5ff553df321 (diff) | |
download | bcm5719-llvm-23922873066c22cdf5c06b2ceb5cd2d75846ecb6.tar.gz bcm5719-llvm-23922873066c22cdf5c06b2ceb5cd2d75846ecb6.zip |
Change this llvm_unreachable to report_fatal_error, since it can
be triggered by valid, if dubious, IR.
llvm-svn: 110240
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 77d6ba14179..1ba63100956 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1268,10 +1268,17 @@ static const MCExpr *LowerConstant(const Constant *CV, AsmPrinter &AP) { ConstantFoldConstantExpression(CE, AP.TM.getTargetData())) if (C != CE) return LowerConstant(C, AP); -#ifndef NDEBUG - CE->dump(); -#endif - llvm_unreachable("FIXME: Don't support this constant expr"); + + // Otherwise report the problem to the user. + { + std::string S; + raw_string_ostream OS(S); + OS << "Unsupported expression in static initializer: "; + WriteAsOperand(OS, CE, /*PrintType=*/false, + !AP.MF ? 0 : AP.MF->getFunction()->getParent()); + report_fatal_error(OS.str()); + } + return MCConstantExpr::Create(0, Ctx); case Instruction::GetElementPtr: { const TargetData &TD = *AP.TM.getTargetData(); // Generate a symbolic expression for the byte address |