From 2f1aa118a4a81fbdc200c42bf7e4c9fe5ce30705 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Jan 2004 03:38:37 +0000 Subject: finegrainify namespacification llvm-svn: 10839 --- llvm/tools/bugpoint/CrashDebugger.cpp | 102 ++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 49 deletions(-) (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp') diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index af64d7a9af6..ecb17342cb7 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -28,21 +28,22 @@ #include "Support/FileUtilities.h" #include #include +using namespace llvm; namespace llvm { - -class DebugCrashes : public ListReducer { - BugDriver &BD; -public: - DebugCrashes(BugDriver &bd) : BD(bd) {} - - // doTest - Return true iff running the "removed" passes succeeds, and running - // the "Kept" passes fail when run on the output of the "removed" passes. If - // we return true, we update the current module of bugpoint. - // - virtual TestResult doTest(std::vector &Removed, - std::vector &Kept); -}; + class DebugCrashes : public ListReducer { + BugDriver &BD; + public: + DebugCrashes(BugDriver &bd) : BD(bd) {} + + // doTest - Return true iff running the "removed" passes succeeds, and + // running the "Kept" passes fail when run on the output of the "removed" + // passes. If we return true, we update the current module of bugpoint. + // + virtual TestResult doTest(std::vector &Removed, + std::vector &Kept); + }; +} DebugCrashes::TestResult DebugCrashes::doTest(std::vector &Prefix, @@ -82,22 +83,24 @@ DebugCrashes::doTest(std::vector &Prefix, return NoFailure; } -class ReduceCrashingFunctions : public ListReducer { - BugDriver &BD; -public: - ReduceCrashingFunctions(BugDriver &bd) : BD(bd) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept) { - if (!Kept.empty() && TestFuncs(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestFuncs(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestFuncs(std::vector &Prefix); -}; +namespace llvm { + class ReduceCrashingFunctions : public ListReducer { + BugDriver &BD; + public: + ReduceCrashingFunctions(BugDriver &bd) : BD(bd) {} + + virtual TestResult doTest(std::vector &Prefix, + std::vector &Kept) { + if (!Kept.empty() && TestFuncs(Kept)) + return KeepSuffix; + if (!Prefix.empty() && TestFuncs(Prefix)) + return KeepPrefix; + return NoFailure; + } + + bool TestFuncs(std::vector &Prefix); + }; +} bool ReduceCrashingFunctions::TestFuncs(std::vector &Funcs) { // Clone the program to try hacking it apart... @@ -143,27 +146,29 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector &Funcs) { } -/// ReduceCrashingBlocks reducer - This works by setting the terminators of all -/// terminators except the specified basic blocks to a 'ret' instruction, then -/// running the simplify-cfg pass. This has the effect of chopping up the CFG -/// really fast which can reduce large functions quickly. -/// -class ReduceCrashingBlocks : public ListReducer { - BugDriver &BD; -public: - ReduceCrashingBlocks(BugDriver &bd) : BD(bd) {} +namespace llvm { + /// ReduceCrashingBlocks reducer - This works by setting the terminators of + /// all terminators except the specified basic blocks to a 'ret' instruction, + /// then running the simplify-cfg pass. This has the effect of chopping up + /// the CFG really fast which can reduce large functions quickly. + /// + class ReduceCrashingBlocks : public ListReducer { + BugDriver &BD; + public: + ReduceCrashingBlocks(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept) { - if (!Kept.empty() && TestBlocks(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestBlocks(Prefix)) - return KeepPrefix; - return NoFailure; - } + virtual TestResult doTest(std::vector &Prefix, + std::vector &Kept) { + if (!Kept.empty() && TestBlocks(Kept)) + return KeepSuffix; + if (!Prefix.empty() && TestBlocks(Prefix)) + return KeepPrefix; + return NoFailure; + } - bool TestBlocks(std::vector &Prefix); -}; + bool TestBlocks(std::vector &Prefix); + }; +} bool ReduceCrashingBlocks::TestBlocks(std::vector &BBs) { // Clone the program to try hacking it apart... @@ -403,4 +408,3 @@ bool BugDriver::debugCrash() { return false; } -} // End llvm namespace -- cgit v1.2.3