Commit Graph

83 Commits

Author SHA1 Message Date
NAKAMURA Takumi ce60d4cd4d llvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.
llvm-svn: 127858
2011-03-18 03:21:04 +00:00
Chris Lattner cee9db2b6f fix dumping of METADATA_ATTACHMENT2 names, patch by Peter Housel!
llvm-svn: 125367
2011-02-11 05:50:01 +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
Dan Gohman f749ad734f Give CurStreamType's enum a name. This works around what is apparently
a bug in Apple GCC 4.0.

llvm-svn: 121409
2010-12-09 20:35:40 +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
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
Dan Gohman 6dbbab6895 Discard metadata produced by LLVM 2.7. The value enumeration it used
is different from what the code now uses in a two ways: NamedMDNodes
were considered Values and included in the numbering, and the
function-local metadata counter wasn't reset between functions.

The later problem breaks lazy deserialization, so instead of trying
to emulate the old numbering, just drop the old metadata. The only
in-tree use case is debug info with LTO, where the QOI loss is
considered acceptable.

llvm-svn: 113557
2010-09-09 23:12:39 +00:00
Dan Gohman 3d051ff2bc Remove an unused command-line option.
llvm-svn: 111367
2010-08-18 17:20:51 +00:00
Dan Gohman aa28801f6a Make llvm-bcanalyzer print out the full enum name for all metadata
code ids, not just some of them.

llvm-svn: 108543
2010-07-16 18:28:07 +00:00
Chris Lattner 07d09ed49a Add special case bitcode support for DebugLoc. This avoids
having the bitcode writer materialize mdnodes for all the
debug location tuples when writing out the bc file and 
stores the information in a more compact form.  For example,
the -O0 -g bc file for combine.c in 176.gcc shrinks from
739392 to 512096 bytes.

This concludes my planned short-term debug info work.

llvm-svn: 100261
2010-04-03 02:17:50 +00:00
Chris Lattner ebc6f14766 add a couple missing enum names.
llvm-svn: 100257
2010-04-03 01:05:24 +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
Daniel Dunbar e813b22b13 Make llvm-bcanalyzer percentages more readable.
llvm-svn: 82772
2009-09-25 16:04:21 +00:00
Daniel Dunbar 75359a7c2f Strip trailing whitespace.
llvm-svn: 82771
2009-09-25 16:03:57 +00:00
Duncan Sands 3cf0cdee4c Print INST_INBOUNDS_GEP rather than UnknownCode30.
Likewise for constant inbounds GEP.

llvm-svn: 82763
2009-09-25 12:28:37 +00:00
Devang Patel af206b8c88 Write and read metadata attachments.
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Duncan Sands 54dd438394 Fix the build when using gcc-4.4 on linux. Header needed
for stderr and fprintf.

llvm-svn: 79909
2009-08-24 10:59:01 +00:00
Chris Lattner c521f54198 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Devang Patel 5ac2f49516 Handle NamedMDNode.
llvm-svn: 77633
2009-07-30 23:03:19 +00:00
Devang Patel e059ba6ed2 Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Devang Patel 7428d8acec Introduce MetadataBase, a base class for MDString and MDNode.
Derive MDString directly from MetadataBase. 
Introduce new bitcode block to hold metadata.

llvm-svn: 76759
2009-07-22 17:43: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
Dan Gohman d8db376071 Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Nick Lewycky aed2a66189 Add missing codenames to the .bc analyzer.
llvm-svn: 72684
2009-06-01 04:41:03 +00:00
Dan Gohman cee10c5351 Fix a compiler warning on hosts where uint64_t isn't unsigned long long.
llvm-svn: 70548
2009-05-01 16:33:33 +00:00
Chris Lattner 0e3f50d8cf give bitstreamreader an API to ignore names for blocks/records,
only llvm-bcanalyzer wants this info.

llvm-svn: 70239
2009-04-27 20:04:08 +00:00
Chris Lattner 1cf8069c5f Print statistics for each record kind saying the number of bits
and % abbreviated.  For example:

	Record Histogram:
		  Count    # Bits   % Abv  Record Kind
		  25738   3424174  100.00  SM_SLOC_INSTANTIATION_ENTRY
		    814    562079  100.00  SM_SLOC_FILE_ENTRY
		    798     34110          SM_HEADER_FILE_INFO
		      3     91104  100.00  SM_SLOC_BUFFER_BLOB
		      3       498  100.00  SM_SLOC_BUFFER_ENTRY
		      1       465          SM_LINE_TABLE

llvm-svn: 70215
2009-04-27 18:15:27 +00:00
Chris Lattner bf419a9328 clean up the output of llvm-bcanalyzer by using printf
instead of ostreams for formatting.

llvm-svn: 70214
2009-04-27 17:59:34 +00:00
Chris Lattner a6fdf5a8c9 Add two new record types to the blockinfo block:
BLOCKNAME and SETRECORDNAME.  This allows a bitcode
file to be self describing with pretty names for 
records and blocks in addition to numbers.  This
enhances llvm-bcanalyzer to use this to print prettily.

llvm-svn: 70165
2009-04-26 22:21:57 +00:00
Chris Lattner 277800a643 Make a major API change to BitstreamReader: split all the reading
state out of the BitstreamReader class into a BitstreamCursor class.
Doing this allows the client to have multiple cursors into the same
file, each with potentially different live block stacks and
abbreviation records.

llvm-svn: 70157
2009-04-26 20:59:02 +00:00
Chris Lattner 73ab815c27 Add an API for the bitstream reader to read blobs and return
them by reference, instead of packing each byte into a
smallvector.

llvm-svn: 68486
2009-04-07 02:56:46 +00:00
Chris Lattner 2ed6a20934 stub out code for reading record with blobs as blobs. Not active yet.
llvm-svn: 68472
2009-04-06 22:44:40 +00:00
Chris Lattner b9e07fd297 Teach llvm-bcanalyzer to skip over the header we use on LLVM IR files.
llvm-svn: 68458
2009-04-06 20:54:32 +00:00
Dan Gohman cff6953c45 Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.

llvm-svn: 68227
2009-04-01 18:45:54 +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
Nick Lewycky 3707f1e6f3 Update to add newer bitcodes.
llvm-svn: 58852
2008-11-07 14:52:51 +00:00
Oscar Fuentes a229b3c9a7 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Nick Lewycky 4d43d3c72c Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.

llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Chris Lattner 6f2ffdb73f Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.

llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Nick Lewycky 3cc9be0b59 Add an unwind_to field to basic blocks, making them Users instead of Values.
This is the first checkin for PR1269, the new EH infrastructure.

llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Nick Lewycky 36c00f834a Also handle "getresult".
llvm-svn: 47797
2008-03-01 21:47:06 +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
Christopher Lamb 54dd24c2a7 Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.

llvm-svn: 44858
2007-12-11 08:59:05 +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 0e535c3c8e Pretty straightforward replacement of "bytecode" by "bitcode"
performed on tools/ first, in order not to cause lethal damage

llvm-svn: 37877
2007-07-04 21:55:50 +00:00
Chris Lattner 6d80e21a1d switch tools to bitcode instead of bytecode
llvm-svn: 36868
2007-05-06 09:29:57 +00:00