Fix a bug that David Greene found in the DAGCombiner's logic
[oota-llvm.git] / lib / CodeGen / GCMetadata.cpp
index f2978f88882ce6b778bd5cb37768ce8b89924e0e..cf2ebb39ad8235078827f0dc61d452c810472150 100644 (file)
@@ -129,7 +129,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";
@@ -189,7 +189,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 +205,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;