Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.
llvm-svn: 2395
diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
index 21456a2..c6cb81f 100644
--- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
@@ -34,6 +34,8 @@
MallocFunc = FreeFunc = 0;
}
+ const char *getPassName() const { return "Lower Allocations"; }
+
// doPassInitialization - For the lower allocations pass, this ensures that a
// module contains a declaration for a malloc and a free function.
//
@@ -54,6 +56,8 @@
public:
inline RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
+ const char *getPassName() const { return "Raise Allocations"; }
+
// doPassInitialization - For the raise allocations pass, this finds a
// declaration for malloc and free if they exist.
//
@@ -216,5 +220,3 @@
Pass *createRaiseAllocationsPass() {
return new RaiseAllocations();
}
-
-