aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-12-11Bitcode: Add METADATA_NODE and METADATA_VALUEDuncan P. N. Exon Smith1-0/+2
This reflects the typelessness of `Metadata` in the bitcode format, removing types from all metadata operands. `METADATA_VALUE` represents a `ValueAsMetadata`, and always has two fields: the type and the value. `METADATA_NODE` represents an `MDNode`, and unlike `METADATA_OLD_NODE`, doesn't store types. It stores operands at their ID+1 so that `0` can reference `nullptr` operands. Part of PR21532. llvm-svn: 224073
2014-12-11Bitcode: Add `OLD_` prefix to metadata node recordsDuncan P. N. Exon Smith1-2/+2
I'm about to change these, so move the old ones out of the way. Part of PR21532. llvm-svn: 224070
2014-08-30Teach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream.Jordan Rose1-28/+79
This allows streams that only use BLOCKINFO for debugging purposes to omit the block entirely. As long as another stream is available with the correct BLOCKINFO, the first stream can still be analyzed and dumped. As part of this commit, BitstreamReader gets a move constructor and move assignment operator, as well as a takeBlockInfo method. llvm-svn: 216826
2014-08-01Remove some calls to std::move.Rafael Espindola1-4/+4
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
2014-07-28Bitcode: Serialize (and recover) use-list orderDuncan P. N. Exon Smith1-1/+2
Predict and serialize use-list order in bitcode. This makes the option `-preserve-bc-use-list-order` work *most* of the time, but this is still experimental. - Builds a full value-table up front in the writer, sets up a list of use-list orders to write out, and discards the table. This is a simpler first step than determining the order from the various overlapping IDs of values on-the-fly. - The shuffles stored in the use-list order list have an unnecessarily large memory footprint. - `blockaddress` expressions cause functions to be materialized out-of-order. For now I've ignored this problem, so use-list orders will be wrong for constants used by functions that have block addresses taken. There are a couple of ways to fix this, but I don't have a concrete plan yet. - When materializing functions lazily, the use-lists for constants will not be correct. This use case is out of scope: what should the use-list order be, if it's incomplete? This is part of PR5680. llvm-svn: 214125
2014-07-06Update the MemoryBuffer API to use ErrorOr.Rafael Espindola1-4/+5
llvm-svn: 212405
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola1-3/+1
llvm-svn: 210876
2014-06-12Don't use 'using std::error_code' in include/llvm.Rafael Espindola1-0/+1
This should make sure that most new uses use the std prefix. llvm-svn: 210835
2014-06-12Remove system_error.h.Rafael Espindola1-1/+1
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper1-17/+17
llvm-svn: 207176
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-2/+1
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2014-01-13[cleanup] Move the Dominators.h and Verifier.h headers into the IRChandler Carruth1-1/+1
directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. llvm-svn: 199082
2013-10-12Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz1-0/+1
llvm-svn: 192519
2013-06-25keep only the StringRef version of getFileOrSTDIN.Rafael Espindola1-1/+1
llvm-svn: 184826
2013-02-12Add static cast to unsigned char whenever a character classification ↵Guy Benyei1-1/+1
function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
2013-02-10Update with attribute group IDs.Bill Wendling1-11/+14
llvm-svn: 174847
2013-01-20switch llvm-bcanalyzer onto the new cursor APIs, allowing deletion ofChris Lattner1-69/+73
the old ReadRecord methods. llvm-svn: 172952
2013-01-19fix method name.Chris Lattner1-1/+1
llvm-svn: 172921
2012-12-04Sort the #include lines for tools/...Chandler Carruth1-3/+2
Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
2012-11-28Add back support for reading and parsing 'deplibs'.Bill Wendling1-0/+1
This is for backwards compatibility for pre-3.x bc files. The code reads the code, but does nothing with it. llvm-svn: 168779
2012-11-27Remove the dependent libraries feature.Bill Wendling1-1/+0
The dependent libraries feature was never used and has bit-rotted. Remove it. llvm-svn: 168694
2012-09-05Stop casting away const qualifier needlessly.Roman Divacky1-1/+1
llvm-svn: 163258
2012-09-05Fix a bug.Jan Wen Voung1-1/+1
llvm-svn: 163242
2012-09-05revert the additional stuff.Jan Wen Voung1-6/+4
llvm-svn: 163241
2012-09-05Clean up llvm-bcanalyzer to print to consistent streams.Jan Wen Voung1-13/+17
Avoid interleaving fprintf(stderr,...) and outs() << ...; Also add a column to show "bytes-per" for each record. llvm-svn: 163240
2012-03-19fix PR12301 - llvm-bcanalyze should print to stdout, not stderr (except for ↵Chris Lattner1-48/+48
errors). llvm-svn: 153065
2012-02-06Enable streaming of bitcodeDerek Schuff1-3/+3
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[unwind removal] Remove a the obsolete 'unwind' enum value.Bill Wendling1-1/+0
llvm-svn: 149911
2012-01-30Add bitcode reader and writer support for ConstantDataAggregate, whichChris Lattner1-0/+2
should be feature complete now. Lets see if it works. llvm-svn: 149215
2012-01-10Remove unnecessary default cases in switches that cover all enum values.David Blaikie1-1/+0
llvm-svn: 147855
2011-12-07Update bcanalyzer to handle new USELIST_BLOCK/USELIST_CODE_ENTRY.Chad Rosier1-0/+6
llvm-svn: 146079
2011-11-27remove support for reading llvm 2.9 .bc files. LLVM 3.1 is only compatible ↵Chris Lattner1-10/+0
back to 3.0 llvm-svn: 145164
2011-11-03Remove some cruft from the BitcodeWriter, while still maintaining backwardChad Rosier1-1/+2
compatibility in the BitcodeReader. llvm-svn: 143598
2011-07-09Land the long talked about "type system rewrite" patch. ThisChris Lattner1-20/+25
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-06-17Drop the "2" suffix on some enums.Chris Lattner1-3/+3
llvm-svn: 133274
2011-06-17remove support for a bunch of obsolete instruction encodingsChris Lattner1-6/+0
and other backward compatibility hacks. llvm-svn: 133273
2011-06-17Remove some "2" suffixes from the metadata enums now that "1" is gone.Chris Lattner1-4/+4
llvm-svn: 133269
2011-06-17remove bitcode reader support for LLVM 2.7 metadata encoding.Chris Lattner1-5/+0
llvm-svn: 133268
2011-03-18llvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.NAKAMURA Takumi1-5/+5
llvm-svn: 127858
2011-02-11fix dumping of METADATA_ATTACHMENT2 names, patch by Peter Housel!Chris Lattner1-1/+1
llvm-svn: 125367
2010-12-16MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer1-5/+5
via an out parm. llvm-svn: 121958
2010-12-09Give CurStreamType's enum a name. This works around what is apparentlyDan Gohman1-4/+11
a bug in Apple GCC 4.0. llvm-svn: 121409
2010-12-09Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer1-2/+5
error_code &ec. And fix clients. llvm-svn: 121379
2010-11-29Merge System into Support.Michael J. Spencer1-1/+1
llvm-svn: 120298
2010-09-09Discard metadata produced by LLVM 2.7. The value enumeration it usedDan Gohman1-0/+6
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-08-18Remove an unused command-line option.Dan Gohman1-3/+0
llvm-svn: 111367
2010-07-16Make llvm-bcanalyzer print out the full enum name for all metadataDan Gohman1-4/+4
code ids, not just some of them. llvm-svn: 108543
2010-04-03Add special case bitcode support for DebugLoc. This avoidsChris Lattner1-0/+2
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-03add a couple missing enum names.Chris Lattner1-0/+2
llvm-svn: 100257
2009-09-25Make llvm-bcanalyzer percentages more readable.Daniel Dunbar1-5/+7
llvm-svn: 82772