From 189d19fb04d53aeccd0d45783f62fd516fb05508 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 21 Nov 2003 20:23:48 +0000 Subject: Finegrainify namespacification llvm-svn: 10131 --- llvm/lib/VMCore/Verifier.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'llvm/lib/VMCore/Verifier.cpp') diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index b517dacb440..48384e882c9 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -57,8 +57,7 @@ #include "llvm/Support/InstVisitor.h" #include "Support/STLExtras.h" #include - -namespace llvm { +using namespace llvm; namespace { // Anonymous namespace for class @@ -158,9 +157,11 @@ namespace { // Anonymous namespace for class void WriteValue(const Value *V) { if (!V) return; - if (isa(V)) + if (isa(V)) { std::cerr << *V; - else { + } else if (const Type *Ty = dyn_cast(V)) { + WriteTypeSymbolic(std::cerr, Ty, Mod); + } else { WriteAsOperand (std::cerr, V, true, true, Mod); std::cerr << "\n"; } @@ -184,6 +185,8 @@ namespace { // Anonymous namespace for class }; RegisterOpt X("verify", "Module Verifier"); +} // End anonymous namespace + // Assert - We know that cond should be true, if not print an error message. #define Assert(C, M) \ @@ -569,19 +572,18 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { "Illegal # arguments for intrinsic function!", IF); } -} // End anonymous namespace //===----------------------------------------------------------------------===// // Implement the public interfaces to this file... //===----------------------------------------------------------------------===// -FunctionPass *createVerifierPass() { +FunctionPass *llvm::createVerifierPass() { return new Verifier(); } // verifyFunction - Create -bool verifyFunction(const Function &f) { +bool llvm::verifyFunction(const Function &f) { Function &F = (Function&)f; assert(!F.isExternal() && "Cannot verify external functions"); @@ -600,12 +602,10 @@ bool verifyFunction(const Function &f) { // verifyModule - Check a module for errors, printing messages on stderr. // Return true if the module is corrupt. // -bool verifyModule(const Module &M) { +bool llvm::verifyModule(const Module &M) { PassManager PM; Verifier *V = new Verifier(); PM.add(V); PM.run((Module&)M); return V->Broken; } - -} // End llvm namespace -- cgit v1.2.3