diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-28 05:14:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-28 05:14:06 +0000 |
commit | 2e9175a0858a2f5005716e4a84ec03f757c25966 (patch) | |
tree | 0b2687344eed0069d7ee386f72beae9049ebeee8 /lib/VMCore/Pass.cpp | |
parent | d43035e1d75fa3faeb3e61ad1e067b60d36d5e65 (diff) |
Minor changes to allow Modules (which are no longer Values) to work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 14ebd50dd1..beef60fd47 100644 --- a/lib/VMCore/Pass.cpp +++ b/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"; } |