Commit Graph

125 Commits

Author SHA1 Message Date
Derek Schuff 8b2dcad4b5 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.

llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Daniel Dunbar 27a7489a03 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Daniel Dunbar 57fb3ae997 LLVMBuild: Add description files for the LLVM tools.
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Daniel Dunbar 96d812a68d build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Chris Lattner 0f214ebe5a eliminate the Type::getDescription() method, using "<<" instead. This
removes some gunk from LLVMContext.

llvm-svn: 133360
2011-06-18 21:18:23 +00:00
Stuart Hastings ec54bd755f Reapply: Add type output to llvm-dis annotations. Patch by Yuri!
llvm-svn: 127824
2011-03-17 19:50:04 +00:00
Stuart Hastings ead01c40e1 Revert 127813 while fixing broken test.
llvm-svn: 127814
2011-03-17 16:54:27 +00:00
Stuart Hastings 8e08a786bf Add type output to llvm-dis. Patch by Yuri!
llvm-svn: 127813
2011-03-17 16:30:14 +00:00
Oscar Fuentes 1fc0c8ab78 Update link components for llvm-dis and LTO.
llvm-svn: 127545
2011-03-12 16:48:49 +00:00
Devang Patel 982efb5c89 While printing annotations, print line number and variable name if debug info is present.
llvm-svn: 127470
2011-03-11 18:07:33 +00:00
Michael J. Spencer a646f39c67 llvm-dis: Fix memory leak. ParseBitcodeFile should be taking ownership of
the MemoryBuffer*, however, it doesn't seem to delete it.

llvm-svn: 122004
2010-12-16 22:37:52 +00:00
Michael J. Spencer 5223d53697 llvm-dis: Simplify MemoryBuffer usage.
llvm-svn: 121975
2010-12-16 16:23:38 +00:00
Michael J. Spencer 7fda8fee25 Fix whitespace.
llvm-svn: 121974
2010-12-16 16:23:30 +00:00
Daniel Dunbar 2115a3f033 Fix some compiler warnings.
llvm-svn: 121959
2010-12-16 04:36:42 +00:00
Michael J. Spencer 39a0ffc394 MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Michael J. Spencer 7b6fef82d4 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Michael J. Spencer 447762da85 Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Dan Gohman 0df7ea4c24 Move tool_output_file into its own file.
llvm-svn: 115973
2010-10-07 20:32:40 +00:00
Michael J. Spencer 93c9b2ea93 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer dc38d36ccb CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner 7f2f0930a7 add a new "llvm-dis -show-annotations" option, which causes it to print
#uses comments, with a testcase.

llvm-svn: 112906
2010-09-02 23:21:44 +00:00
Dan Gohman a2233f2801 Make tool_output_file's raw_ostream instance a member variable instead
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-09-01 14:20:41 +00:00
Dan Gohman 268b0f4781 Use the new tool_output_file in several tools. This fixes a variety
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.

llvm-svn: 111603
2010-08-20 01:07:01 +00:00
Chris Lattner 823aed16f9 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner 7ba0661f27 Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Dan Gohman 972c9c5e0a Don't bother using a PassManager just to print a Module.
llvm-svn: 81858
2009-09-15 15:33:42 +00:00
Dan Gohman e592923603 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
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-09-11 20:46:33 +00:00
Dan Gohman 61a8796ddb Make LLVM command-line tools overwrite their output files without -f.
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-25 15:34:52 +00:00
Chris Lattner 9e6f1f160a Change raw_fd_ostream to take flags as an optional bitmask
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-23 02:51:22 +00:00
Dan Gohman ee05152cfa Convert more tools code from cerr and cout to errs() and outs().
llvm-svn: 76070
2009-07-16 15:30:09 +00:00
Owen Anderson 19251ec836 To simplify the upcoming context-on-type change, switch all command line 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-15 22:16:10 +00:00
Dan Gohman 607818a2c1 Add a Force option to raw_fd_ostream to specify whether opening
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-15 17:29:42 +00:00
Owen Anderson 1cf085d558 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson 6773d388aa Add a pointer to the owning LLVMContext to Module. This requires threading 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-07-01 16:58:40 +00:00
Chris Lattner e3fc2d13be Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Chris Lattner 3f60b4803a disable exports from a bunch more tools, those without plugins.
llvm-svn: 65558
2009-02-26 19:01:11 +00:00
Daniel Dunbar 81b5fa5620 Move Print*Pass to use raw_ostream.
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Daniel Dunbar 54d5b9ea2c Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Oscar Fuentes a229b3c9a7 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Chris Lattner 345353d6b4 remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Chris Lattner 8fa21acd25 remove attributions from tools/utils makefiles.
llvm-svn: 45414
2007-12-29 20:07:17 +00:00
Dan Gohman 2c6a821fd7 Move the space in overview output for commands out of each of the
commands and into the common code.

llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Gabor Greif e16561cd5d Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Chris Lattner 9e9a34c6bf use the new MemoryBuffer interfaces to simplify error reporting in clients.
llvm-svn: 36900
2007-05-06 23:45:49 +00:00
Chris Lattner 6d80e21a1d switch tools to bitcode instead of bytecode
llvm-svn: 36868
2007-05-06 09:29:57 +00:00
Chris Lattner f693167d68 simplify code
llvm-svn: 36837
2007-05-06 04:43:36 +00:00
Chris Lattner 6694f60bec Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
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.

llvm-svn: 36554
2007-04-29 07:54:31 +00:00
Chris Lattner 8ca41bfb57 don't break reading from stdin
llvm-svn: 36336
2007-04-22 06:35:20 +00:00
Chris Lattner e224446728 teach llvm-dis to read bitcode files
llvm-svn: 36334
2007-04-22 06:31:02 +00:00
Chris Lattner a0e49f2ead push bytecode decompressor out through APIs. Now the bytecode reader
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-07 21:41:02 +00:00