1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

202 Commits

Author SHA1 Message Date
Jan Wen Voung
dded44f8b5 Fix a bug.
llvm-svn: 163242
2012-09-05 20:56:00 +00:00
Jan Wen Voung
b8aa3ea9c3 revert the additional stuff.
llvm-svn: 163241
2012-09-05 20:55:57 +00:00
Jan Wen Voung
cdc254176c Clean up llvm-bcanalyzer to print to consistent streams.
Avoid interleaving fprintf(stderr,...) and outs() << ...;

Also add a column to show "bytes-per" for each record.

llvm-svn: 163240
2012-09-05 20:55:54 +00:00
Chris Lattner
688f466fd4 fix PR12301 - llvm-bcanalyze should print to stdout, not stderr (except for errors).
llvm-svn: 153065
2012-03-19 23:40:48 +00:00
Derek Schuff
f522835510 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
Bill Wendling
fa3b7c42a8 [unwind removal] Remove a the obsolete 'unwind' enum value.
llvm-svn: 149911
2012-02-06 21:55:35 +00:00
Chris Lattner
d52c923a50 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.

llvm-svn: 149215
2012-01-30 00:51:16 +00:00
David Blaikie
8d47bb30e3 Remove unnecessary default cases in switches that cover all enum values.
llvm-svn: 147855
2012-01-10 16:47:17 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Chad Rosier
e3225d38e4 Update bcanalyzer to handle new USELIST_BLOCK/USELIST_CODE_ENTRY.
llvm-svn: 146079
2011-12-07 21:45:13 +00:00
Chris Lattner
03be469732 remove support for reading llvm 2.9 .bc files. LLVM 3.1 is only compatible back to 3.0
llvm-svn: 145164
2011-11-27 05:48:27 +00:00
Daniel Dunbar
efa02a0c3d LLVMBuild: Add description files for the LLVM tools.
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Chad Rosier
1caee0fa23 Remove some cruft from the BitcodeWriter, while still maintaining backward
compatibility in the BitcodeReader.

llvm-svn: 143598
2011-11-03 00:14:01 +00:00
Daniel Dunbar
81780d9982 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
a106725fc5 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

llvm-svn: 134829
2011-07-09 17:41:24 +00:00
Chris Lattner
dd6d168c92 Drop the "2" suffix on some enums.
llvm-svn: 133274
2011-06-17 18:17:37 +00:00
Chris Lattner
04d8431b16 remove support for a bunch of obsolete instruction encodings
and other backward compatibility hacks.

llvm-svn: 133273
2011-06-17 18:09:11 +00:00
Chris Lattner
d59a556c3a Remove some "2" suffixes from the metadata enums now that "1" is gone.
llvm-svn: 133269
2011-06-17 17:50:30 +00:00
Chris Lattner
c7bf0d0128 remove bitcode reader support for LLVM 2.7 metadata encoding.
llvm-svn: 133268
2011-06-17 17:48:53 +00:00
NAKAMURA Takumi
a4eec0fe83 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
90800350dd fix dumping of METADATA_ATTACHMENT2 names, patch by Peter Housel!
llvm-svn: 125367
2011-02-11 05:50:01 +00:00
Michael J. Spencer
86f6a9ac6e 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
d5b1cf4bc8 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
15483143ec 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
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Michael J. Spencer
90f807fda5 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
98ad3f2ea7 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Dan Gohman
a9936d3f97 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
ea23bfd45c Remove an unused command-line option.
llvm-svn: 111367
2010-08-18 17:20:51 +00:00
Dan Gohman
f4d2b52ffe 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
c2f273b52d 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
6fb3f169c8 add a couple missing enum names.
llvm-svn: 100257
2010-04-03 01:05:24 +00:00
Chris Lattner
276811b58a 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
827ef5a368 Make llvm-bcanalyzer percentages more readable.
llvm-svn: 82772
2009-09-25 16:04:21 +00:00
Daniel Dunbar
e963728182 Strip trailing whitespace.
llvm-svn: 82771
2009-09-25 16:03:57 +00:00
Duncan Sands
79ffac01fb 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
c195f74dee Write and read metadata attachments.
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Duncan Sands
dd8e4f488d 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
3203639c35 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
7f2d10ec49 Handle NamedMDNode.
llvm-svn: 77633
2009-07-30 23:03:19 +00:00
Devang Patel
6b2162686a 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
5794cb80ad 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
6abbc537f4 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
60dce4c56b Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Nick Lewycky
8e4eb22f45 Add missing codenames to the .bc analyzer.
llvm-svn: 72684
2009-06-01 04:41:03 +00:00
Dan Gohman
908d546da3 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
c8838e7b00 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
bd53d3b24f 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
23dfe61ece 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
f84ee5d944 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
a43dcba929 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
12dadd5a5e 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
a98e068143 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
7e2c9be68e 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
770f4158e5 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
1b05680d5f 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
4869ed1aa7 disable exports from a bunch more tools, those without plugins.
llvm-svn: 65558
2009-02-26 19:01:11 +00:00
Nick Lewycky
b75c0781c3 Update to add newer bitcodes.
llvm-svn: 58852
2008-11-07 14:52:51 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Nick Lewycky
1f831c0f57 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
d141d16ed7 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
b02fe64d8b 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
03545e3023 Also handle "getresult".
llvm-svn: 47797
2008-03-01 21:47:06 +00:00
Chris Lattner
309aeb140b remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Chris Lattner
11718ad357 remove attributions from tools/utils makefiles.
llvm-svn: 45414
2007-12-29 20:07:17 +00:00
Christopher Lamb
7368604860 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
2e8245a376 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
9e76bbf30e 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
5947ecbfbf switch tools to bitcode instead of bytecode
llvm-svn: 36868
2007-05-06 09:29:57 +00:00
Chris Lattner
c9ca38fedf add inline asm code
llvm-svn: 36826
2007-05-06 01:50:11 +00:00
Chris Lattner
6d0c5eb739 add a denser encoding for null terminated strings, add a 6-bit abbrev as
well.  This shrinks kc++ from 2724088 to 2717360 bytes.

llvm-svn: 36821
2007-05-06 00:53:07 +00:00
Chris Lattner
d3a2d22853 emit spiffy little histograms of codes, if enabled. Don't print averages if
there is only one item.

llvm-svn: 36773
2007-05-05 01:46:49 +00:00
Chris Lattner
b0f9baa6d6 do not charge subblock sizes to the parent block.
llvm-svn: 36772
2007-05-05 01:29:31 +00:00
Chris Lattner
817fbdc02d update to new APIs, make output a bit (haha) nicer
llvm-svn: 36768
2007-05-05 00:17:42 +00:00
Chris Lattner
6ded0dd248 add support for new codes/block
llvm-svn: 36726
2007-05-04 03:01:41 +00:00
Chris Lattner
adc0d44678 add phi
llvm-svn: 36611
2007-05-01 02:43:46 +00:00
Chris Lattner
5c6ead0212 Implement much expanded dumper support. We now print stuff like:
<MODULE_BLOCK NumWords=27 BlockCodeSize=3>
  <TYPE_BLOCK NumWords=7 BlockCodeSize=4>
    <NUMENTRY op0=7>
    <POINTER op0=1>
    <FUNCTION op0=0 op1=2 op2=2 op3=2 op4=2>
    <VECTOR op0=2 op1=3>
    <INTEGER op0=64>
    <VECTOR op0=8 op1=5>
    <INTEGER op0=16>
    <VOID>
...

With work, the operands can be pretty printed symbolically.

llvm-svn: 36579
2007-04-29 21:48:19 +00:00
Chris Lattner
112645d174 add some simple per-block statistics
llvm-svn: 36576
2007-04-29 20:00:02 +00:00
Chris Lattner
25f905472a Implement support to read an arbitrary bitcode file. Next up, dumping the
file symbolically and actually computing statistics.

llvm-svn: 36557
2007-04-29 08:31:14 +00:00
Chris Lattner
d48cbf15f8 very early support for analyzing a bitstream. This opens the file, starts
reading the stream, and detects whether it is LLVM IR or not.

llvm-svn: 36556
2007-04-29 08:12:22 +00:00
Chris Lattner
799a92b8af fit in 80 cols
llvm-svn: 36551
2007-04-29 05:51:00 +00:00
Chris Lattner
43d0b955a3 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
Chris Lattner
41c5ddb8cb make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called.

llvm-svn: 32250
2006-12-06 01:18:01 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Chris Lattner
2da81d7d76 Use LINK_COMPONENTS to specify *components* to link against instead of
using USED_LIBS to specify *libraries* to link against.

llvm-svn: 30090
2006-09-04 05:59:09 +00:00
Chris Lattner
9f5a13c5c0 Tools require EH for their top-level try blocks.
llvm-svn: 29035
2006-07-07 00:46:19 +00:00
Chris Lattner
c55abf6f70 Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway.
llvm-svn: 29017
2006-07-06 18:02:27 +00:00
Reid Spencer
94a443bb29 Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.

llvm-svn: 28610
2006-06-01 01:30:27 +00:00
Misha Brukman
960a8d47d7 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Reid Spencer
298f85282c For PR351:
* 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.

llvm-svn: 19192
2004-12-30 05:36:08 +00:00
Reid Spencer
b79950be4d Add LLVMbzip2 library, now required.
llvm-svn: 18255
2004-11-25 20:22:06 +00:00
Reid Spencer
d3f7233495 Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer
5574857063 We're not doing automake any more
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
817a069ea4 Initial version of automake Makefile.am file.
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
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/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
e044a2172e Add the LLVMsystem.a library as it is now used for operating system
independence of the tool.

llvm-svn: 16092
2004-08-29 19:29:38 +00:00
Reid Spencer
8cb2484800 The functions in Signal.h are now in the llvm::sys namespace - adjust
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Reid Spencer
be70baea8a Correct to change interface of the analyzer.
llvm-svn: 15986
2004-08-21 21:00:24 +00:00
Reid Spencer
1642054814 Name Change: llvm-abcd -> llvm-bcanalyzer
llvm-svn: 14555
2004-07-02 03:22:53 +00:00