diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-29 14:57:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-29 14:57:45 +0000 |
commit | 37104aace8a7f5ed8e11e905aeaf579b526e3b8e (patch) | |
tree | c6f7dcb73419953abda386a20b175d1f83f2b050 /llvm/lib/Transforms/IPO | |
parent | e2eb99eb6215eb1d3dc78b1e20192ca6221d7d5f (diff) | |
download | bcm5719-llvm-37104aace8a7f5ed8e11e905aeaf579b526e3b8e.tar.gz bcm5719-llvm-37104aace8a7f5ed8e11e905aeaf579b526e3b8e.zip |
Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.
llvm-svn: 2395
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r-- | llvm/lib/Transforms/IPO/ConstantMerge.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/DeadTypeElimination.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalDCE.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/Internalize.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/OldPoolAllocate.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/SimpleStructMutation.cpp | 5 |
7 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ConstantMerge.cpp b/llvm/lib/Transforms/IPO/ConstantMerge.cpp index a635b8d21be..146911e818d 100644 --- a/llvm/lib/Transforms/IPO/ConstantMerge.cpp +++ b/llvm/lib/Transforms/IPO/ConstantMerge.cpp @@ -65,6 +65,8 @@ namespace { unsigned LastConstantSeen; public: inline ConstantMerge() : LastConstantSeen(0) {} + + const char *getPassName() const {return "Merge Duplicate Global Constants";} // doInitialization - For this pass, process all of the globals in the // module, eliminating duplicate constants. @@ -89,6 +91,8 @@ namespace { }; struct DynamicConstantMerge : public ConstantMerge { + const char *getPassName() const { return "Dynamic Constant Merge"; } + // runOnFunction - Check to see if any globals have been added to the // global list for the module. If so, eliminate them. // diff --git a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp index 3ba6057fad2..dc330b29f8a 100644 --- a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -36,6 +36,8 @@ static const Type *PtrSByte = 0; // 'sbyte*' type namespace { struct CleanupGCCOutput : public FunctionPass { + const char *getPassName() const { return "Cleanup GCC Output"; } + // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and // they make the output uglier to look at, so we nuke them. @@ -337,6 +339,8 @@ bool CleanupGCCOutput::doFinalization(Module *M) { namespace { struct FunctionResolvingPass : public Pass { + const char *getPassName() const { return "Resolve Functions"; } + bool run(Module *M); }; } diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp index cd9c35f058a..e852a6a29fc 100644 --- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp +++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp @@ -49,6 +49,8 @@ static bool RemoveUnreachableFunctions(Module *M, CallGraph &CallGraph) { namespace { struct GlobalDCE : public Pass { + const char *getPassName() const { return "Dead Global Elimination"; } + // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. // diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index 1581323bea1..ba64a6abce0 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp @@ -271,6 +271,7 @@ static bool doFunctionInlining(Function *F) { namespace { struct FunctionInlining : public FunctionPass { + const char *getPassName() const { return "Function Inlining"; } virtual bool runOnFunction(Function *F) { return doFunctionInlining(F); } diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp index 8bb1a9c111c..c84be9b93a2 100644 --- a/llvm/lib/Transforms/IPO/Internalize.cpp +++ b/llvm/lib/Transforms/IPO/Internalize.cpp @@ -12,6 +12,8 @@ #include "llvm/Function.h" class InternalizePass : public Pass { + const char *getPassName() const { return "Internalize Functions"; } + virtual bool run(Module *M) { bool FoundMain = false; // Look for a function named main... for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) diff --git a/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp b/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp index 6ccd043a85c..bb990020529 100644 --- a/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp +++ b/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp @@ -199,6 +199,8 @@ namespace { // Define the pass class that we implement... struct PoolAllocate : public Pass { + const char *getPassName() const { return "Pool Allocate"; } + PoolAllocate() { switch (ReqPointerSize) { case Ptr32bits: POINTERTYPE = Type::UIntTy; break; diff --git a/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp b/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp index 33e02895047..c0d9ef46bc2 100644 --- a/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp +++ b/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp @@ -18,12 +18,13 @@ using std::set; using std::pair; namespace { - class SimpleStructMutation : public MutateStructTypes { - public: + struct SimpleStructMutation : public MutateStructTypes { enum Transform { SwapElements, SortElements } CurrentXForm; SimpleStructMutation(enum Transform XForm) : CurrentXForm(XForm) {} + const char *getPassName() const { return "Simple Struct Mutation"; } + virtual bool run(Module *M) { setTransforms(getTransforms(M, CurrentXForm)); bool Changed = MutateStructTypes::run(M); |