aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-extract/llvm-extract.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-11-29Merge System into Support.Michael J. Spencer1-1/+1
llvm-svn: 120298
2010-10-07Move tool_output_file into its own file.Dan Gohman1-1/+1
llvm-svn: 115973
2010-09-23Fix llvm-extract -delete's lazy loading to materialize the functions thatDan Gohman1-7/+34
will not be deleted, rather than the ones that will. llvm-svn: 114614
2010-09-01Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman1-3/+3
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. llvm-svn: 112706
2010-08-26Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,Dan Gohman1-5/+1
and was over-complicated, and replacing it with a simple implementation. llvm-svn: 112120
2010-08-25Convert llvm-extract to use lazy loading. This makes it substantiallyDan Gohman1-1/+14
faster on large modules. llvm-svn: 112110
2010-08-20Use tool_output_file in llvm-extract and llvm-link too.Dan Gohman1-7/+5
llvm-svn: 111604
2010-08-18Don't register stdout to be deleted on a signal.Dan Gohman1-1/+2
llvm-svn: 111368
2010-07-01Preserve debug info for only extracted symbols.Devang Patel1-0/+1
llvm-svn: 107417
2010-03-24Trim #includes.Dan Gohman1-1/+0
llvm-svn: 99416
2010-02-10Add support to llvm-extract for extracting multiple functions and/orDan Gohman1-23/+29
multiple global variables at a time. llvm-svn: 95825
2009-09-11Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn'tDan Gohman1-16/+20
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. llvm-svn: 81568
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. llvm-svn: 79990
2009-08-23simplify output file selection, fixing two FIXMEs about binary outputChris Lattner1-19/+10
llvm-svn: 79808
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). llvm-svn: 79807
2009-08-18"-" should write to stdout, not stderr.Chris Lattner1-3/+3
llvm-svn: 79310
2009-07-16Convert more tools code from cerr and cout to errs() and outs().Dan Gohman1-4/+4
llvm-svn: 76070
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. llvm-svn: 75846
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. llvm-svn: 75801
2009-07-01Hold the LLVMContext by reference rather than by pointer.Owen Anderson1-1/+1
llvm-svn: 74640
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. llvm-svn: 74614
2009-04-20Use .empty() instead of .size().Dan Gohman1-2/+2
llvm-svn: 69599
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. llvm-svn: 66248
2008-03-07only extract main if the user didn't specify anything to extractAndrew Lenharth1-1/+1
llvm-svn: 48023
2008-03-07make error message reflect default search function nameAndrew Lenharth1-3/+2
llvm-svn: 48021
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 llvm-svn: 48015
2007-12-29remove attributions from tools.Chris Lattner1-2/+2
llvm-svn: 45421
2007-10-08Move the space in overview output for commands out of each of theDan Gohman1-1/+1
commands and into the common code. llvm-svn: 42752
2007-08-08Separate program name from error message with a :Reid Spencer1-1/+1
llvm-svn: 40945
2007-08-08Terminate an error message with a newline.Reid Spencer1-1/+1
llvm-svn: 40943
2007-07-05Here is the bulk of the sanitizing.Gabor Greif1-2/+2
Almost all occurrences of "bytecode" in the sources have been eliminated. llvm-svn: 37913
2007-05-06use the new MemoryBuffer interfaces to simplify error reporting in clients.Chris Lattner1-2/+1
llvm-svn: 36900
2007-05-06switch tools to bitcode instead of bytecodeChris Lattner1-23/+8
llvm-svn: 36868
2007-05-06remove EH cruft, add bitcode supportChris Lattner1-54/+69
llvm-svn: 36841
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. llvm-svn: 34012
2007-02-05For PR411:Reid Spencer1-1/+2
Change getNamedFunction -> getFunction Make llvm-extract run the StripDeadPrototypes pass. llvm-svn: 33921
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. llvm-svn: 33918
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. llvm-svn: 33597
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. llvm-svn: 32298
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. llvm-svn: 32250
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. llvm-svn: 31990
2006-06-16Don't pass target name into TargetData anymore, it is never used or needed.Chris Lattner1-1/+1
llvm-svn: 28831
2005-04-24extract has been renamed to llvm-extract to avoid conflicting with another toolMisha Brukman1-0/+106
llvm-svn: 21498