#include "llvm/CodeGen/Passes.h"
#include "llvm/Function.h"
#include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
return S;
}
}
-
+
cerr << "unsupported GC: " << Name << "\n";
- abort();
+ llvm_unreachable(0);
}
GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) {
}
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";
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";
return new Deleter();
}
-Deleter::Deleter() : FunctionPass(intptr_t(&ID)) {}
+Deleter::Deleter() : FunctionPass(&ID) {}
const char *Deleter::getPassName() const {
return "Delete Garbage Collector Information";
}
bool Deleter::doFinalization(Module &M) {
- GCModuleInfo *GMI = getAnalysisToUpdate<GCModuleInfo>();
+ GCModuleInfo *GMI = getAnalysisIfAvailable<GCModuleInfo>();
assert(GMI && "Deleter didn't require GCModuleInfo?!");
GMI->clear();
return false;