summaryrefslogtreecommitdiff
path: root/tools/llvm-extract
AgeCommit message (Collapse)AuthorFilesLines
2009-08-25Make LLVM command-line tools overwrite their output files without -f.Dan Gohman1-6/+6
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
2009-08-23simplify output file selection, fixing two FIXMEs about binary outputChris Lattner1-19/+10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner1-2/+3
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
2009-08-18"-" should write to stdout, not stderr.Chris Lattner1-3/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Convert more tools code from cerr and cout to errs() and outs().Dan Gohman1-4/+4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15To simplify the upcoming context-on-type change, switch all command line ↵Owen Anderson1-1/+1
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
2009-07-15Add a Force option to raw_fd_ostream to specify whether openingDan Gohman1-15/+14
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
2009-07-01Hold the LLVMContext by reference rather than by pointer.Owen Anderson1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson1-2/+4
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
2009-04-20Use .empty() instead of .size().Dan Gohman1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Change various llvm utilities to use PrettyStackTraceProgram inChris Lattner1-2/+6
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
2009-02-26disable exports from a bunch more tools, those without plugins.Chris Lattner1-0/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22Initial support for the CMake build system.Oscar Fuentes1-0/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07only extract main if the user didn't specify anything to extractAndrew Lenharth1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07make error message reflect default search function nameAndrew Lenharth1-3/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07add a pass that can extract all kinds of global values, not just functions. ↵Andrew Lenharth1-7/+23
Update llvm-extract to use it and optionally extract a global variable if you want it too git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29remove attributions from tools.Chris Lattner1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29remove attributions from tools/utils makefiles.Chris Lattner1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45414 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08Move the space in overview output for commands out of each of theDan Gohman1-1/+1
commands and into the common code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08Separate program name from error message with a :Reid Spencer1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08Terminate an error message with a newline.Reid Spencer1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05Here is the bulk of the sanitizing.Gabor Greif1-2/+2
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
2007-05-06use the new MemoryBuffer interfaces to simplify error reporting in clients.Chris Lattner1-2/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36900 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06switch tools to bitcode instead of bytecodeChris Lattner2-24/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06remove EH cruft, add bitcode supportChris Lattner2-56/+71
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07push bytecode decompressor out through APIs. Now the bytecode readerChris Lattner1-1/+3
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
2007-02-05For PR411:Reid Spencer1-1/+2
Change getNamedFunction -> getFunction Make llvm-extract run the StripDeadPrototypes pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05For PR411:Reid Spencer1-1/+0
This patch replaces the SymbolTable class with ValueSymbolTable which does not support types planes. This means that all symbol names in LLVM must now be unique. The patch addresses the necessary changes to deal with this and removes code no longer needed as a result. This completes the bulk of the changes for this PR. Some cleanup patches will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28Propagate changes from my local tree. This patch includes:Anton Korobeynikov1-2/+7
1. New parameter attribute called 'inreg'. It has meaning "place this parameter in registers, if possible". This is some generalization of gcc's regparm(n) attribute. It's currently used only in X86-32 backend. 2. Completely rewritten CC handling/lowering code inside X86 backend. Merged stdcall + c CCs and fastcall + fast CC. 3. Dropped CSRET CC. We cannot add struct return variant for each target-specific CC (e.g. stdcall + csretcc and so on). 4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in on first attribute has meaning 'This is hidden pointer to structure return. Handle it gently'. 5. Fixed small bug in llvm-extract + add new feature to FunctionExtraction pass, which relinks all internal-linkaged callees from deleted function to external linkage. This will allow further linking everything together. NOTEs: 1. Documentation will be updated soon. 2. llvm-upgrade should be improved to translate csret => sret. Before this, there will be some unexpected test fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling1-9/+9
now cerr, cout, and NullStream resp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.Chris Lattner1-0/+2
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
2006-11-29Replacing std::iostreams with llvm iostreams. Some of these changes involveBill Wendling1-6/+9
adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-04Use LINK_COMPONENTS to specify *components* to link against instead ofChris Lattner1-3/+1
using USED_LIBS to specify *libraries* to link against. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30090 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07Tools require EH for their top-level try blocks.Chris Lattner1-0/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29035 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16Don't pass target name into TargetData anymore, it is never used or needed.Chris Lattner1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28831 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01Use archive libraries instead of object files for VMCore, BCReader,Reid Spencer1-3/+3
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate these changes. This was done to speed up link times. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28610 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27Move some constant folding code shared by Analysis and Transform passesJohn Criswell1-1/+1
into the LLVMAnalysis library. This allows LLVMTranform and LLVMTransformUtils to be archives and linked with LLVMAnalysis.a, which provides any missing definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-261. Remove libraries no longer created from the list of libraries linked into theJohn Criswell1-1/+1
SparcV9 JIT. 2. Make LLVMTransformUtils a relinked object file and always link it before LLVMAnalysis.a. These two libraries have circular dependencies on each other which creates problem when building the SparcV9 JIT. This change fixes the dependency on all platforms problems with a minimum of fuss. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-24extract has been renamed to llvm-extract to avoid conflicting with another toolMisha Brukman2-4/+20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21498 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22Remove trailing whitespaceMisha Brukman1-5/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21428 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22Use binary mode for reading/writing bytecode filesJeff Cohen1-4/+6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-30For PR351:Reid Spencer1-41/+48
* 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
2004-09-01Changes For Bug 352Reid Spencer1-1/+1
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
2004-08-29The functions in Signal.h are now in the llvm::sys namespace - adjustReid Spencer1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27Header file movedChris Lattner1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-22Add command-line option to select whether to isolate or delete function fromMisha Brukman1-1/+5
module. Default is `isolate' as before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-19Make sure to print a stack trace whenever an error signal is delivered toChris Lattner1-0/+2
the tool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11633 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-18Give extract -o and -f options, just like every other tool!Chris Lattner1-4/+28
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-28Fix extract to use the right TargetData, like Bugpoint does.Brian Gaeke1-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9561 91177308-0d34-0410-b5e6-96231b3b80d8