summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-28 05:14:06 +0000
committerChris Lattner <sabre@nondot.org>2002-04-28 05:14:06 +0000
commita454b5b7c52aaf015c6e15b5f4f4f28a0f772b64 (patch)
tree6f3c3b5dc15652f6c52286e4fd5b05ad244c3b1b /llvm/lib
parent17a4573d2182a291d1aba505c2cf33bdfc8b4637 (diff)
downloadbcm5719-llvm-a454b5b7c52aaf015c6e15b5f4f4f28a0f772b64.tar.gz
bcm5719-llvm-a454b5b7c52aaf015c6e15b5f4f4f28a0f772b64.zip
Minor changes to allow Modules (which are no longer Values) to work
llvm-svn: 2361
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Pass.cpp19
-rw-r--r--llvm/lib/VMCore/PassManagerT.h10
2 files changed, 15 insertions, 14 deletions
diff --git a/llvm/lib/VMCore/Pass.cpp b/llvm/lib/VMCore/Pass.cpp
index 14ebd50dd16..beef60fd470 100644
--- a/llvm/lib/VMCore/Pass.cpp
+++ b/llvm/lib/VMCore/Pass.cpp
@@ -49,22 +49,21 @@ void PMDebug::PrintPassStructure(Pass *P) {
}
void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
- Pass *P, Value *V) {
+ Pass *P, Annotable *V) {
if (PassDebugging >= PassExecutions) {
std::cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
<< typeid(*P).name();
if (V) {
std::cerr << "' on ";
- switch (V->getValueType()) {
- case Value::ModuleVal:
+
+ if (dynamic_cast<Module*>(V)) {
std::cerr << "Module\n"; return;
- case Value::FunctionVal:
- std::cerr << "Function '" << V->getName(); break;
- case Value::BasicBlockVal:
- std::cerr << "BasicBlock '" << V->getName(); break;
- default:
- std::cerr << typeid(*V).name() << " '" << V->getName(); break;
- }
+ } else if (Function *F = dynamic_cast<Function*>(V))
+ std::cerr << "Function '" << F->getName();
+ else if (BasicBlock *BB = dynamic_cast<BasicBlock*>(V))
+ std::cerr << "BasicBlock '" << BB->getName();
+ else if (Value *Val = dynamic_cast<Value*>(V))
+ std::cerr << typeid(*Val).name() << " '" << Val->getName();
}
std::cerr << "'...\n";
}
diff --git a/llvm/lib/VMCore/PassManagerT.h b/llvm/lib/VMCore/PassManagerT.h
index a8c8d579be2..d4dfda02d66 100644
--- a/llvm/lib/VMCore/PassManagerT.h
+++ b/llvm/lib/VMCore/PassManagerT.h
@@ -15,6 +15,7 @@
#include "llvm/Pass.h"
#include <string>
#include <algorithm>
+class Annotable;
//===----------------------------------------------------------------------===//
// PMDebug class - a set of debugging functions, that are not to be
@@ -25,7 +26,7 @@ struct PMDebug {
// -debug-pass on the command line of the tool being used.
//
static void PrintPassStructure(Pass *P);
- static void PrintPassInformation(unsigned,const char*,Pass *, Value *);
+ static void PrintPassInformation(unsigned,const char*,Pass *, Annotable *);
static void PrintAnalysisSetInfo(unsigned,const char*,Pass *P,
const std::vector<AnalysisID> &);
};
@@ -105,7 +106,8 @@ public:
for (unsigned i = 0, e = Passes.size(); i < e; ++i) {
PassClass *P = Passes[i];
- PMDebug::PrintPassInformation(getDepth(), "Executing Pass", P, (Value*)M);
+ PMDebug::PrintPassInformation(getDepth(), "Executing Pass", P,
+ (Annotable*)M);
// Get information about what analyses the pass uses...
AnalysisUsage AnUsage;
@@ -128,7 +130,7 @@ public:
if (Changed)
PMDebug::PrintPassInformation(getDepth()+1, "Made Modification", P,
- (Value*)M);
+ (Annotable*)M);
PMDebug::PrintAnalysisSetInfo(getDepth(), "Preserved", P,
AnUsage.getPreservedSet());
PMDebug::PrintAnalysisSetInfo(getDepth(), "Provided", P,
@@ -165,7 +167,7 @@ public:
for (std::vector<Pass*>::iterator I = DeadPass.begin(),E = DeadPass.end();
I != E; ++I) {
PMDebug::PrintPassInformation(getDepth()+1, "Freeing Pass", *I,
- (Value*)M);
+ (Annotable*)M);
(*I)->releaseMemory();
}
}
OpenPOWER on IntegriCloud