summaryrefslogtreecommitdiff
path: root/tools/opt
Commit message (Collapse)AuthorAge
...
* 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
* Remove ShortNames from getNodeLabel in DOTGraphTraitsTobias Grosser2009-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90134 91177308-0d34-0410-b5e6-96231b3b80d8
* Instantiate DefaultDOTGraphTraitsTobias Grosser2009-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90133 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
* Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn'tDan Gohman2009-09-11
| | | | | | | | | | | | | | | | working. To support this, add an is_displayed() function to raw_ostream, and generalize Process::StandardOutIsDisplayed and friends in order to support it. Also, call RemoveFileOnSignal before creating a file instead of after, so that the file isn't left behind if the program is interrupted between when the file is created and RemoveFileOnSignal is called. While here, add a -S to llvm-extract and port it to IRReader so that it supports assembly input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81568 91177308-0d34-0410-b5e6-96231b3b80d8
* opt: Add -S option to print output as LLVM assembly.Daniel Dunbar2009-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81082 91177308-0d34-0410-b5e6-96231b3b80d8
* Use IRReader.h in opt, to support reading of LLVM Assembly files directly.Dan Gohman2009-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80922 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some nasty callgraph dangling pointer problems in Chris Lattner2009-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM command-line tools overwrite their output files without -f.Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
* These flushes were only needed when the code was transitioning betweenDan Gohman2009-08-24
| | | | | | | std::cout and outs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79891 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the ostream version of CheckBitcodeOutputToConsole,Chris Lattner2009-08-23
| | | | | | | | change the raw_ostream one to take the raw_ostream byref instead of byptr. Prune #includes, eliminate a use of Streams.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79863 91177308-0d34-0410-b5e6-96231b3b80d8
* use raw_fd_ostream instead of fstream with graphwriter,Chris Lattner2009-08-23
| | | | | | | flush the right stream in opt.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79837 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner2009-08-23
| | | | | | | update all code that this affects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79830 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | instead of as two bools. Use this to add a F_Append flag which has the obvious behavior. Other unrelated changes conflated into this patch: 1. REmove EH stuff from llvm-dis and llvm-as, the try blocks are dead. 2. Simplify the filename inference code in llvm-as/llvm-dis, because raw_fd_ostream does the right thing with '-'. 3. Switch machine verifier to use raw_ostream instead of ostream (Which is the thing that needed append in the first place). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
* Make unit-at-a-time on by default to match the behavior of llvm-gcc.Eric Christopher2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79698 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill trailing whitespace.Eric Christopher2009-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79696 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch some clients to Value::getName(), and other getName() userDaniel Dunbar2009-07-22
| | | | | | | | simplification. - NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76789 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in SROA. The FunctionPass::doInitialization method was neverBob Wilson2009-07-17
| | | | | | | | being called so that Context was never initialized. I'm not sure if this is the right fix but at least it keeps opt from crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76220 91177308-0d34-0410-b5e6-96231b3b80d8
* opt: Add -std-link-opts argument, matches llvm-ld's optimizations.Daniel Dunbar2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76199 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more tools code from cerr and cout to errs() and outs().Dan Gohman2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76070 91177308-0d34-0410-b5e6-96231b3b80d8
* To simplify the upcoming context-on-type change, switch all command line ↵Owen Anderson2009-07-15
| | | | | | | | | tools to using the default global context for now. This will let us to hardwire stuff to the global context in the short term while the API is sorted out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75846 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Force option to raw_fd_ostream to specify whether openingDan Gohman2009-07-15
| | | | | | | | | an existing file is considered an error. Convert several tools to use raw_fd_ostream instead of std::ostream, and to use this new option instead of doing a manual check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75801 91177308-0d34-0410-b5e6-96231b3b80d8
* Use errs() instead of std::cerr.Dan Gohman2009-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75791 91177308-0d34-0410-b5e6-96231b3b80d8
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-01
| | | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the global CFGOnly flag by threading a ShortNames parameters ↵Owen Anderson2009-06-24
| | | | | | | | | through the GraphViz rendering code. Update other uses in the codebase for this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74084 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch opt to using StandardPasses.hDaniel Dunbar2009-06-03
| | | | | | | - No functionality change, but please check if you don't believe me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72789 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed file header comment.Misha Brukman2009-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68250 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate several more unnecessary intptr_t casts.Dan Gohman2009-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64888 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename AddReadAttrs to FunctionAttrs, and teach it howDuncan Sands2008-12-31
| | | | | | | | | to work out (in a very simplistic way) which function arguments (pointer arguments only) are only dereferenced and so do not escape. Mark such arguments 'nocapture'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable LoopIndexSplit pass.Devang Patel2008-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60555 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable -loop-index-split for now.Devang Patel2008-11-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60087 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust indent.Zhongxing Xu2008-11-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60081 91177308-0d34-0410-b5e6-96231b3b80d8
* fix memory leak in pass manager when adding an analysis pass that already ↵Nuno Lopes2008-11-04
| | | | | | | | existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58730 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Print*Pass to use raw_ostream.Daniel Dunbar2008-10-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57946 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize PrintModulePass and PrintFunctionPass and addDaniel Dunbar2008-10-21
| | | | | | | | createPrintModulePass and createPrintFunctionPass. - So clients who compile w/o RTTI can use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57933 91177308-0d34-0410-b5e6-96231b3b80d8
* Rationalize the names of passes that print information:Duncan Sands2008-09-23
| | | | | | | | | | | | | | | | | | -callgraph => print-callgraph -callscc => print-callgraph-sccs -cfgscc => print-cfg-sccs -externalfnconstants => print-externalfnconstants -print => print-function -print-alias-sets (no change) -print-callgraph => dot-callgraph -print-cfg => dot-cfg -print-cfg-only => dot-cfg-only -print-dom-info (no change) -printm => print-module -printusedtypes => print-used-types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56487 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the CMake build system.Oscar Fuentes2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn on the AddReadAttrs pass.Duncan Sands2008-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56345 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach -callgraph to always print the callgraph (as theDuncan Sands2008-09-19
| | | | | | | | | description says it does), not just when -analyze is used as well. This means printing to stderr, so adjust some tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56337 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comments, help messages.Devang Patel2008-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56282 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix cut-n-pasto.Devang Patel2008-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56265 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -O1, -O2 and -O3 that matches llvm-gcc's -O1, -O2 and -O3 respectively.Devang Patel2008-09-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56255 91177308-0d34-0410-b5e6-96231b3b80d8
* End of the GlobalsModRef experiment.Duncan Sands2008-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56222 91177308-0d34-0410-b5e6-96231b3b80d8
* Give GlobalsModRef a whirl in the nightly testers.Duncan Sands2008-09-12
| | | | | | | | | | I placed it just before GVN because that it is the pass most likely to benefit from it. Some quick and dirty testing confirms that this is a decent place for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56144 91177308-0d34-0410-b5e6-96231b3b80d8
* Backout 55429Devang Patel2008-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55432 91177308-0d34-0410-b5e6-96231b3b80d8
* Add facility to create a target.Devang Patel2008-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55429 91177308-0d34-0410-b5e6-96231b3b80d8