summaryrefslogtreecommitdiff
path: root/tools/opt/opt.cpp
Commit message (Collapse)AuthorAge
* Remove the LowerSetJmp pass. It wasn't used effectively by any of the targets.Bill Wendling2011-08-03
| | | | | | | This is some of my original LLVM code. *wipes tear* git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136821 91177308-0d34-0410-b5e6-96231b3b80d8
* move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,Rafael Espindola2011-08-02
| | | | | | | but it solves a layering violation since things in Support are not supposed to use things in Transforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136726 91177308-0d34-0410-b5e6-96231b3b80d8
* We only do always-inlining at -O1; make opt reflect that.Eli Friedman2011-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132693 91177308-0d34-0410-b5e6-96231b3b80d8
* initialize and finalize function passes, pointed out by Cameron.Chris Lattner2011-05-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131843 91177308-0d34-0410-b5e6-96231b3b80d8
* switch opt to using PassManagerBuilder.hChris Lattner2011-05-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131824 91177308-0d34-0410-b5e6-96231b3b80d8
* Added *hidden* flags -print-options and -print-all-options soAndrew Trick2011-04-05
| | | | | | | | | | | | | | | | | | | | developers can see if their driver changed any cl::Option's. The current implementation isn't perfect but handles most kinds of options. This is nice to have when decomposing the stages of compilation and moving between different drivers. It's also a good sanity check when comparing results produced by different command line invocations that are expected to produce the comparable results. Note: This is not an attempt to prolong the life of cl::Option. On the contrary, it's a placeholder for a feature that must exist when cl::Option is replaced by a more appropriate framework. A new framework needs: a central option registry, dynamic name lookup, non-global containers of option values (e.g. per-module, per-function), *and* the ability to print options values and their defaults at any point during compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2011-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128905 91177308-0d34-0410-b5e6-96231b3b80d8
* Update BreakpointPrinter to emit original function names only. Devang Patel2011-04-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128839 91177308-0d34-0410-b5e6-96231b3b80d8
* add a way to disable all builtins, wire it up to opt's ↵Chris Lattner2011-02-18
| | | | | | -disable-simplifylibcalls flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125978 91177308-0d34-0410-b5e6-96231b3b80d8
* Have opt set up a specific TargetLibraryInfo for modulesChris Lattner2011-02-18
| | | | | | | with a triple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125970 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -disable-simplify-libcalls work with -std-compile-optsPeter Collingbourne2011-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125824 91177308-0d34-0410-b5e6-96231b3b80d8
* While printing "interesting" breakpoint locations for debug info quality ↵Devang Patel2011-01-31
| | | | | | test harness, focus only on entry block's terminator for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124610 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionPassPrinter should contain the name of the pass printedTobias Grosser2011-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123941 91177308-0d34-0410-b5e6-96231b3b80d8
* Print breakpoints for call instructions. This is used by optimized debug ↵Devang Patel2010-12-09
| | | | | | info test harness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121432 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a simple breakpoint location printer. This will be used by upcoming ↵Devang Patel2010-12-07
| | | | | | "debug info in optimized code" quality test harness to set breakpoints at "interesting" locations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121078 91177308-0d34-0410-b5e6-96231b3b80d8
* Move check of command line options after command line parsing.Tobias Grosser2010-12-02
| | | | | | | | | The check to not allow -analyze and -disable-output at the same time was done before parsing the command line flags. Therefore it never triggered, and in case both options where used opt segfaulted. Fix this by moving this check a after command line parsing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120732 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the opt -O2 / opt -O3 inliner thresholds to be the same as llvm-gcc andJakob Stoklund Olesen2010-11-02
| | | | | | clang are using. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118118 91177308-0d34-0410-b5e6-96231b3b80d8
* Add RegionPass support.Tobias Grosser2010-10-20
| | | | | | | A RegionPass is executed like a LoopPass but on the regions detected by the RegionInfo pass instead of the loops detected by the LoopInfo pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116905 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Move tool_output_file into its own file.Dan Gohman2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
* Execute all Pass Printers even if -quiet is set.Tobias Grosser2010-09-08
| | | | | | | | | | | | Follow the same logic in the LoopPass, ModulePass and CallGraphSCCPass printers, as it was already used in the BasicBlockPass and FunctionPass printers. This is more consistent. The other option would have been to completely disable dumping the analysis information. However, as this information is the only information printed if the -analysis flag is set, calling opt would not do anything at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113360 91177308-0d34-0410-b5e6-96231b3b80d8
* Include original pass name in the PassPrinter's name.Tobias Grosser2010-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113359 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-01
| | | | | | | | | | | of a base class. This makes it possible to unregister the file from FilesToRemove when the file is done. Also, this eliminates the need for formatted_tool_output_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new tool_output_file in several tools. This fixes a varietyDan Gohman2010-08-20
| | | | | | | | | of problems with output files being left behind or output streams being left unclosed. Fix llvm-mc to respect the -o option in all modes, rather than hardcoding outs() in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111603 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow the -analyze option to follow the -o option, which defaults toDan Gohman2010-08-18
| | | | | | | standard output, instead of just hardcoding outs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111372 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't translate "-" to outs() manually; raw_ostream does that automatically.Dan Gohman2010-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111371 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert some tab stops into spaces.Duncan Sands2010-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't special-case stdout in llvm::WriteBitcodeToFile; just considerDan Gohman2010-05-27
| | | | | | | | it to be the caller's responsibility to provide a stream in binary mode. This fixes a layering violation and avoids an outs() call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104878 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create an output stream when output is disabled.Dan Gohman2010-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104875 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calling outs() and fouts() when the stream isn't really needed.Dan Gohman2010-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104873 91177308-0d34-0410-b5e6-96231b3b80d8
* Use regular PassManager instead of FunctionPassManager in opt, since itDan Gohman2010-05-14
| | | | | | | isn't doing lazy streaming. This also fixes a missing doFinalization call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103774 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce a new CallGraphSCC class, and pass it aroundChris Lattner2010-04-16
| | | | | | | | | to CallGraphSCCPass's instead of passing around a std::vector<CallGraphNode*>. No functionality change, but now we have a much tidier interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
* Trim #includes.Dan Gohman2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99416 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid leaking the FunctionPassManager from opt.Jeffrey Yasskin2010-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99180 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a dangling pointer dereference, PassManager::add can delete the Pass.Benjamin Kramer2010-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96576 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* elimiante the dynamic_cast's from opt.Chris Lattner2010-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94160 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify code.Chris Lattner2010-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94159 91177308-0d34-0410-b5e6-96231b3b80d8
* Make opt -O3 act more like clang -O3 etc., by making the inlining thresholdsEli Friedman2010-01-18
| | | | | | | | match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93798 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create a (empty) output file, and don't warn about bitcode outputDan Gohman2010-01-17
| | | | | | | | | | | | to a console, when --analyze is used. Similarly, avoid creating an empty output file when --disable-output is used. Print a warning when the -o option appears with either --analyze or --disable-output, to indicate that the option is being ignored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93685 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable debug buffering.David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92667 91177308-0d34-0410-b5e6-96231b3b80d8
* when opt crashes, print its command line arguments as a pretty stack trace.Chris Lattner2009-12-09
| | | | | | | Somehow opt was missed when this was added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90912 91177308-0d34-0410-b5e6-96231b3b80d8
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-03
| | | | | | depend on target data to supply it within the test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8
* nothing opt uses can throw, remove the try block and -fexceptions whenChris Lattner2009-10-22
| | | | | | | building opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84816 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some command line options for twiddling the default data layoutChris Lattner2009-10-22
| | | | | | | used by opt when a module doesn't specify one. Patch from Kenneth Uildriks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84814 91177308-0d34-0410-b5e6-96231b3b80d8
* There seems to be no reason for opt's -S option to be hidden.Duncan Sands2009-10-14
| | | | | | | Make it visible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84127 91177308-0d34-0410-b5e6-96231b3b80d8