diff options
author | Justin Bogner <mail@justinbogner.com> | 2016-09-02 01:21:37 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2016-09-02 01:21:37 +0000 |
commit | 8d0a08115a382983cf553bc834b20253bf82a5c2 (patch) | |
tree | d6d915ea669e8e2978e1c158b7c34e7d9394d38e /llvm/tools/bugpoint/BugDriver.h | |
parent | bc469276599aa69c4804d47e2fd9f8bc51ea60f0 (diff) | |
download | bcm5719-llvm-8d0a08115a382983cf553bc834b20253bf82a5c2.tar.gz bcm5719-llvm-8d0a08115a382983cf553bc834b20253bf82a5c2.zip |
bugpoint: clang-format all of bugpoint. NFC
I'm going to clean up the APIs here a bit and touch many many lines
anyway.
llvm-svn: 280450
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.h')
-rw-r--r-- | llvm/tools/bugpoint/BugDriver.h | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.h b/llvm/tools/bugpoint/BugDriver.h index 52ec2c00564..7ae2d5c2f99 100644 --- a/llvm/tools/bugpoint/BugDriver.h +++ b/llvm/tools/bugpoint/BugDriver.h @@ -45,13 +45,13 @@ extern bool DisableSimplifyCFG; extern bool BugpointIsInterrupted; class BugDriver { - LLVMContext& Context; + LLVMContext &Context; const char *ToolName; // argv[0] of bugpoint std::string ReferenceOutputFile; // Name of `good' output file - Module *Program; // The raw program, linked together + Module *Program; // The raw program, linked together std::vector<std::string> PassesToRun; - AbstractInterpreter *Interpreter; // How to run the program - AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. + AbstractInterpreter *Interpreter; // How to run the program + AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. CC *cc; bool run_find_bugs; unsigned Timeout; @@ -63,14 +63,13 @@ class BugDriver { friend class ReduceMisCodegenFunctions; public: - BugDriver(const char *toolname, bool find_bugs, - unsigned timeout, unsigned memlimit, bool use_valgrind, - LLVMContext& ctxt); + BugDriver(const char *toolname, bool find_bugs, unsigned timeout, + unsigned memlimit, bool use_valgrind, LLVMContext &ctxt); ~BugDriver(); const char *getToolName() const { return ToolName; } - LLVMContext& getContext() const { return Context; } + LLVMContext &getContext() const { return Context; } // Set up methods... these methods are used to copy information about the // command line arguments into instance variables of BugDriver. @@ -80,9 +79,7 @@ public: void setPassesToRun(const std::vector<std::string> &PTR) { PassesToRun = PTR; } - const std::vector<std::string> &getPassesToRun() const { - return PassesToRun; - } + const std::vector<std::string> &getPassesToRun() const { return PassesToRun; } /// run - The top level method that is invoked after all of the instance /// variables are set up from command line arguments. The \p as_child argument @@ -142,13 +139,11 @@ public: AbstractInterpreter *switchToSafeInterpreter() { AbstractInterpreter *Old = Interpreter; - Interpreter = (AbstractInterpreter*)SafeInterpreter; + Interpreter = (AbstractInterpreter *)SafeInterpreter; return Old; } - void switchToInterpreter(AbstractInterpreter *AI) { - Interpreter = AI; - } + void switchToInterpreter(AbstractInterpreter *AI) { Interpreter = AI; } /// setNewProgram - If we reduce or update the program somehow, call this /// method to update bugdriver with it. This deletes the old module and sets @@ -164,12 +159,10 @@ public: /// executeProgram - This method runs "Program", capturing the output of the /// program to a file. A recommended filename may be optionally specified. /// - std::string executeProgram(const Module *Program, - std::string OutputFilename, + std::string executeProgram(const Module *Program, std::string OutputFilename, std::string Bitcode, const std::string &SharedObjects, - AbstractInterpreter *AI, - std::string *Error) const; + AbstractInterpreter *AI, std::string *Error) const; /// executeProgramSafely - Used to create reference output with the "safe" /// backend, if reference output is not provided. If there is a problem with @@ -181,20 +174,19 @@ public: std::string *Error) const; /// createReferenceFile - calls compileProgram and then records the output - /// into ReferenceOutputFile. Returns true if reference file created, false + /// into ReferenceOutputFile. Returns true if reference file created, false /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE /// this function. /// - bool createReferenceFile(Module *M, const std::string &Filename - = "bugpoint.reference.out-%%%%%%%"); + bool createReferenceFile(Module *M, const std::string &Filename = + "bugpoint.reference.out-%%%%%%%"); /// diffProgram - This method executes the specified module and diffs the /// output against the file specified by ReferenceOutputFile. If the output /// is different, 1 is returned. If there is a problem with the code /// generator (e.g., llc crashes), this will return -1 and set Error. /// - bool diffProgram(const Module *Program, - const std::string &BitcodeFile = "", + bool diffProgram(const Module *Program, const std::string &BitcodeFile = "", const std::string &SharedObj = "", bool RemoveBitcode = false, std::string *Error = nullptr) const; @@ -251,27 +243,27 @@ public: /// or failed, unless Quiet is set. ExtraArgs specifies additional arguments /// to pass to the child bugpoint instance. /// - bool runPasses(Module *Program, - const std::vector<std::string> &PassesToRun, + bool runPasses(Module *Program, const std::vector<std::string> &PassesToRun, std::string &OutputFilename, bool DeleteOutput = false, bool Quiet = false, unsigned NumExtraArgs = 0, - const char * const *ExtraArgs = nullptr) const; + const char *const *ExtraArgs = nullptr) const; /// runPasses - Just like the method above, but this just returns true or /// false indicating whether or not the optimizer crashed on the specified /// input (true = crashed). Does not produce any output. /// - bool runPasses(Module *M, - const std::vector<std::string> &PassesToRun) const { + bool runPasses(Module *M, const std::vector<std::string> &PassesToRun) const { std::string Filename; return runPasses(M, PassesToRun, Filename, true); } - - /// runManyPasses - Take the specified pass list and create different - /// combinations of passes to compile the program with. Compile the program with - /// each set and mark test to see if it compiled correctly. If the passes - /// compiled correctly output nothing and rearrange the passes into a new order. - /// If the passes did not compile correctly, output the command required to + + /// runManyPasses - Take the specified pass list and create different + /// combinations of passes to compile the program with. Compile the program + /// with + /// each set and mark test to see if it compiled correctly. If the passes + /// compiled correctly output nothing and rearrange the passes into a new + /// order. + /// If the passes did not compile correctly, output the command required to /// recreate the failure. This returns true if a compiler error is found. /// bool runManyPasses(const std::vector<std::string> &AllPasses, @@ -304,11 +296,11 @@ std::string getPassesString(const std::vector<std::string> &Passes); /// PrintFunctionList - prints out list of problematic functions /// -void PrintFunctionList(const std::vector<Function*> &Funcs); +void PrintFunctionList(const std::vector<Function *> &Funcs); /// PrintGlobalVariableList - prints out list of problematic global variables /// -void PrintGlobalVariableList(const std::vector<GlobalVariable*> &GVs); +void PrintGlobalVariableList(const std::vector<GlobalVariable *> &GVs); // DeleteGlobalInitializer - "Remove" the global variable by deleting its // initializer, making it external. |