Put comment printing under asm-verbose.
[oota-llvm.git] / lib / CodeGen / GCMetadata.cpp
index f2978f88882ce6b778bd5cb37768ce8b89924e0e..15d9a0529a787da6edb1252f2f8a66ab73af9c03 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Function.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace llvm;
 
@@ -92,9 +93,9 @@ GCStrategy *GCModuleInfo::getOrCreateStrategy(const Module *M,
       return S;
     }
   }
-  
   cerr << "unsupported GC: " << Name << "\n";
-  abort();
+  llvm_unreachable(0);
 }
 
 GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) {
@@ -129,7 +130,7 @@ FunctionPass *llvm::createGCInfoPrinter(std::ostream &OS) {
 }
 
 Printer::Printer(std::ostream &OS)
-  : FunctionPass(intptr_t(&ID)), OS(OS) {}
+  : FunctionPass(&ID), OS(OS) {}
 
 const char *Printer::getPassName() const {
   return "Print Garbage Collector Information";
@@ -143,7 +144,7 @@ void Printer::getAnalysisUsage(AnalysisUsage &AU) const {
 
 static const char *DescKind(GC::PointKind Kind) {
   switch (Kind) {
-    default: assert(0 && "Unknown GC point kind");
+    default: llvm_unreachable("Unknown GC point kind");
     case GC::Loop:     return "loop";
     case GC::Return:   return "return";
     case GC::PreCall:  return "pre-call";
@@ -189,7 +190,7 @@ FunctionPass *llvm::createGCInfoDeleter() {
   return new Deleter();
 }
 
-Deleter::Deleter() : FunctionPass(intptr_t(&ID)) {}
+Deleter::Deleter() : FunctionPass(&ID) {}
 
 const char *Deleter::getPassName() const {
   return "Delete Garbage Collector Information";
@@ -205,7 +206,7 @@ bool Deleter::runOnFunction(Function &MF) {
 }
 
 bool Deleter::doFinalization(Module &M) {
-  GCModuleInfo *GMI = getAnalysisToUpdate<GCModuleInfo>();
+  GCModuleInfo *GMI = getAnalysisIfAvailable<GCModuleInfo>();
   assert(GMI && "Deleter didn't require GCModuleInfo?!");
   GMI->clear();
   return false;