summaryrefslogtreecommitdiff
path: root/tools/llvm-dis/llvm-dis.cpp
Commit message (Collapse)AuthorAge
* 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
* 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
* 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
* 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
* 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
* Change various llvm utilities to use PrettyStackTraceProgram inChris Lattner2009-03-06
| | | | | | | | their main routines. This makes the tools print their argc/argv commands if they crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66248 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
* remove attributions from tools.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45421 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the space in overview output for commands out of each of theDan Gohman2007-10-08
| | | | | | | commands and into the common code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42752 91177308-0d34-0410-b5e6-96231b3b80d8
* Here is the bulk of the sanitizing.Gabor Greif2007-07-05
| | | | | | | Almost all occurrences of "bytecode" in the sources have been eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
* use the new MemoryBuffer interfaces to simplify error reporting in clients.Chris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36900 91177308-0d34-0410-b5e6-96231b3b80d8
* switch tools to bitcode instead of bytecodeChris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36868 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify codeChris Lattner2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36837 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the bitcode reader interface to take a MemoryBuffer instead of knowingChris Lattner2007-04-29
| | | | | | | | | | | | | | | anything about disk I/O itself. This greatly simplifies its interface - eliminating the need for the ReaderWrappers.cpp file. This adds a new option to llvm-dis (-bitcode) which instructs it to read the input file as bitcode. Until/unless the bytecode reader is taught to read from MemoryBuffer, there is no way to handle stdin reading without it. I don't plan to switch the bytecode reader over, I'd rather delete it :), so the option will stay around temporarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36554 91177308-0d34-0410-b5e6-96231b3b80d8
* don't break reading from stdinChris Lattner2007-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36336 91177308-0d34-0410-b5e6-96231b3b80d8
* teach llvm-dis to read bitcode filesChris Lattner2007-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36334 91177308-0d34-0410-b5e6-96231b3b80d8
* push bytecode decompressor out through APIs. Now the bytecode readerChris Lattner2007-02-07
| | | | | | | | | | | | | | | | | | | | | api's look like this: ModuleProvider *getBytecodeModuleProvider( const std::string &Filename, ///< Name of file to be read BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer, std::string* ErrMsg = 0, ///< Optional error message holder BytecodeHandler* H = 0 ///< Optional handler for reader events ); This is ugly, but allows a client to say: getBytecodeModuleProvider("foo", 0); If they do this, there is no dependency on the compression libraries, saving codesize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34012 91177308-0d34-0410-b5e6-96231b3b80d8
* add an option for timing bc file reading.Chris Lattner2007-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33977 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-07
| | | | | | | now cerr, cout, and NullStream resp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
* make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.Chris Lattner2006-12-06
| | | | | | | With this change, I can now move -stats to print when llvm_shutdown is called. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32250 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert to using llvm streams instead of iostreams.Bill Wendling2006-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31989 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21428 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up commentsChris Lattner2005-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19920 91177308-0d34-0410-b5e6-96231b3b80d8
* This has been deprecated for long enough, nuke it.Chris Lattner2005-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19919 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-30
| | | | | | | | | | | * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19192 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix usage of changed function prototypeReid Spencer2004-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17798 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-01
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* The functions in Signal.h are now in the llvm::sys namespace - adjustReid Spencer2004-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16091 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate more traces of the -c optionChris Lattner2004-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14049 91177308-0d34-0410-b5e6-96231b3b80d8
* Header file movedChris Lattner2004-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13813 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to print a stack trace whenever an error signal is delivered to theChris Lattner2004-02-19
| | | | | | | tool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11632 91177308-0d34-0410-b5e6-96231b3b80d8
* Break a line that's over 80cols into two.Misha Brukman2004-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11423 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not advertise our -c option anymoreChris Lattner2004-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11413 91177308-0d34-0410-b5e6-96231b3b80d8
* Mercilessly rip the cbackend out of llvm-dis. Leave a helpful error messageChris Lattner2004-02-13
| | | | | | | for those who have not heard the news. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11412 91177308-0d34-0410-b5e6-96231b3b80d8
* Change how we create the cwriter, and add a buttload of libraries that it nowChris Lattner2004-02-13
| | | | | | | needs. This will be fixed shortly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11407 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore the -llvm optionChris Lattner2003-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9915 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* fix file headerChris Lattner2003-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9294 91177308-0d34-0410-b5e6-96231b3b80d8
* Added copyright header to all C++ source files.John Criswell2003-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9291 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix grammar.Misha Brukman2003-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9026 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming LLVM `dis' to `llvm-dis'.Misha Brukman2003-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8189 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for: -o -Chris Lattner2003-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6485 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill using declarationsChris Lattner2003-05-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6292 91177308-0d34-0410-b5e6-96231b3b80d8
* Give verbose error messages if bytecode file cannot be parsedChris Lattner2003-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5789 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to close the file before deleting itChris Lattner2002-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3905 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor non-functionality changing changes.Chris Lattner2002-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3833 91177308-0d34-0410-b5e6-96231b3b80d8