diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-14 03:38:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-14 03:38:37 +0000 |
commit | fa76183e8e28985dfd17b1d6291c939dab4cbe1d (patch) | |
tree | 5898187ef916460b4a0b844abf0ddee8a8bf1879 /tools/bugpoint/CrashDebugger.cpp | |
parent | 277bafbff7384f282c4a409863c220536d6f09b6 (diff) | |
download | llvm-fa76183e8e28985dfd17b1d6291c939dab4cbe1d.tar.gz llvm-fa76183e8e28985dfd17b1d6291c939dab4cbe1d.tar.bz2 llvm-fa76183e8e28985dfd17b1d6291c939dab4cbe1d.tar.xz |
finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index af64d7a9af..ecb17342cb 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -28,21 +28,22 @@ #include "Support/FileUtilities.h" #include <fstream> #include <set> +using namespace llvm; namespace llvm { - -class DebugCrashes : public ListReducer<const PassInfo*> { - 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<const PassInfo*> &Removed, - std::vector<const PassInfo*> &Kept); -}; + class DebugCrashes : public ListReducer<const PassInfo*> { + 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<const PassInfo*> &Removed, + std::vector<const PassInfo*> &Kept); + }; +} DebugCrashes::TestResult DebugCrashes::doTest(std::vector<const PassInfo*> &Prefix, @@ -82,22 +83,24 @@ DebugCrashes::doTest(std::vector<const PassInfo*> &Prefix, return NoFailure; } -class ReduceCrashingFunctions : public ListReducer<Function*> { - BugDriver &BD; -public: - ReduceCrashingFunctions(BugDriver &bd) : BD(bd) {} - - virtual TestResult doTest(std::vector<Function*> &Prefix, - std::vector<Function*> &Kept) { - if (!Kept.empty() && TestFuncs(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestFuncs(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestFuncs(std::vector<Function*> &Prefix); -}; +namespace llvm { + class ReduceCrashingFunctions : public ListReducer<Function*> { + BugDriver &BD; + public: + ReduceCrashingFunctions(BugDriver &bd) : BD(bd) {} + + virtual TestResult doTest(std::vector<Function*> &Prefix, + std::vector<Function*> &Kept) { + if (!Kept.empty() && TestFuncs(Kept)) + return KeepSuffix; + if (!Prefix.empty() && TestFuncs(Prefix)) + return KeepPrefix; + return NoFailure; + } + + bool TestFuncs(std::vector<Function*> &Prefix); + }; +} bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) { // Clone the program to try hacking it apart... @@ -143,27 +146,29 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &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<BasicBlock*> { - 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<BasicBlock*> { + BugDriver &BD; + public: + ReduceCrashingBlocks(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(std::vector<BasicBlock*> &Prefix, - std::vector<BasicBlock*> &Kept) { - if (!Kept.empty() && TestBlocks(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestBlocks(Prefix)) - return KeepPrefix; - return NoFailure; - } + virtual TestResult doTest(std::vector<BasicBlock*> &Prefix, + std::vector<BasicBlock*> &Kept) { + if (!Kept.empty() && TestBlocks(Kept)) + return KeepSuffix; + if (!Prefix.empty() && TestBlocks(Prefix)) + return KeepPrefix; + return NoFailure; + } - bool TestBlocks(std::vector<BasicBlock*> &Prefix); -}; + bool TestBlocks(std::vector<BasicBlock*> &Prefix); + }; +} bool ReduceCrashingBlocks::TestBlocks(std::vector<BasicBlock*> &BBs) { // Clone the program to try hacking it apart... @@ -403,4 +408,3 @@ bool BugDriver::debugCrash() { return false; } -} // End llvm namespace |