Missed an exit during the conversion.
authorTorok Edwin <edwintorok@gmail.com>
Wed, 8 Jul 2009 20:55:50 +0000 (20:55 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Wed, 8 Jul 2009 20:55:50 +0000 (20:55 +0000)
Will convert assert(0) that don't have abort() to LLVM_UNREACHABLE in a later
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75045 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/CppBackend/CPPBackend.cpp

index 532e3cc4d6c0d5a90e20ea4521b95d2d7cd9cd3d..c4deb4bdb39dc855871315b6c79fd2b109882935 100644 (file)
@@ -35,6 +35,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
@@ -209,7 +210,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Print out labels for the function.
   const Function *F = MF.getFunction();
   switch (F->getLinkage()) {
-  default: assert(0 && "Unknown linkage type!");
+  default: LLVM_UNREACHABLE("Unknown linkage type!");
   case Function::PrivateLinkage:
   case Function::InternalLinkage:
     SwitchToTextSection("\t.text", F);
@@ -306,7 +307,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
         O << TRI->getAsmName(Reg);
       }
     } else
-      assert(0 && "not implemented");
+      LLVM_UNREACHABLE("not implemented");
     break;
   }
   case MachineOperand::MO_Immediate: {
@@ -1113,8 +1114,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
    case GlobalValue::InternalLinkage:
     break;
    default:
-    assert(0 && "Unknown linkage type!");
-    break;
+    LLVM_UNREACHABLE("Unknown linkage type!");
   }
 
   EmitAlignment(Align, GVar);
index 28f58e86f62340aceaadecaa9ebe9574833f074b..6c48ae8d270cc6baf56c2dc23e5989cfbaa9063b 100644 (file)
@@ -28,6 +28,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Config/config.h"
@@ -220,8 +221,7 @@ namespace {
   }
 
   void CppWriter::error(const std::string& msg) {
-    cerr << msg << "\n";
-    exit(2);
+    llvm_report_error(msg);
   }
 
   // printCFP - Print a floating point constant .. very carefully :)