Commit Graph

116 Commits

Author SHA1 Message Date
Ahmed Charles
f4ccd11075 Replace OwningPtr<T> with std::unique_ptr<T>.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 05:51:42 +00:00
Chandler Carruth
56e1394c88 [cleanup] Move the Dominators.h and Verifier.h headers into the IR
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199082 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 09:26:24 +00:00
NAKAMURA Takumi
3aabdebde2 [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 11:13:32 +00:00
Will Dietz
e3ba15c794 Add missing #include's to cctype when using isdigit/alpha/etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192519 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 00:55:57 +00:00
Rafael Espindola
dd5af27a74 keep only the StringRef version of getFileOrSTDIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184826 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 05:28:34 +00:00
Guy Benyei
87d0b9ed14 Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 21:21:59 +00:00
Bill Wendling
8620bd3178 Update with attribute group IDs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-10 23:17:10 +00:00
Chris Lattner
4156ca76e3 switch llvm-bcanalyzer onto the new cursor APIs, allowing deletion of
the old ReadRecord methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:50:32 +00:00
Chris Lattner
bc837200eb fix method name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 21:37:14 +00:00
Chandler Carruth
f010c464a1 Sort the #include lines for tools/...
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 10:44:52 +00:00
Bill Wendling
3defc0bfa6 Add back support for reading and parsing 'deplibs'.
This is for backwards compatibility for pre-3.x bc files. The code reads the
code, but does nothing with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168779 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 08:41:48 +00:00
Bill Wendling
efd08d413c Remove the dependent libraries feature.
The dependent libraries feature was never used and has bit-rotted. Remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 09:55:56 +00:00
Joerg Sonnenberger
975bc072ae Adjust llvm-ar and llvm-ranlib to not depend on exception handling.
Always use an exit code of 1, but print the help message if useful.
Remove the exception handling tag in llvm-as, llvm-dis and
llvm-bcanalyzer, where it isn't used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 10:49:15 +00:00
Roman Divacky
5932429765 Stop casting away const qualifier needlessly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 22:26:57 +00:00
Jan Wen Voung
a759eb3bb9 Fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163242 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 20:56:00 +00:00
Jan Wen Voung
73e562a95a revert the additional stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 20:55:57 +00:00
Jan Wen Voung
851343c741 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 20:55:54 +00:00
Chris Lattner
e0ac6f8a7d fix PR12301 - llvm-bcanalyze should print to stdout, not stderr (except for errors).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 23:40:48 +00:00
Derek Schuff
2ea93875b2 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:30:29 +00:00
Bill Wendling
705f4813af [unwind removal] Remove a the obsolete 'unwind' enum value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149911 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:55:35 +00:00
Chris Lattner
d408f06048 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 00:51:16 +00:00
David Blaikie
2bd335470f Remove unnecessary default cases in switches that cover all enum values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 16:47:17 +00:00
Daniel Dunbar
4ab406d7fc LLVMBuild: Remove trailing newline, which irked me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 19:48:00 +00:00
Chad Rosier
837b4e4a44 Update bcanalyzer to handle new USELIST_BLOCK/USELIST_CODE_ENTRY.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 21:45:13 +00:00
Chris Lattner
dbc88494ee remove support for reading llvm 2.9 .bc files. LLVM 3.1 is only compatible back to 3.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 05:48:27 +00:00
Daniel Dunbar
0d3c223035 LLVMBuild: Add description files for the LLVM tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 22:59:39 +00:00
Chad Rosier
cde5464970 Remove some cruft from the BitcodeWriter, while still maintaining backward
compatibility in the BitcodeReader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143598 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 00:14:01 +00:00
Daniel Dunbar
8c39c9647d build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142401 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 19:27:24 +00:00
Chris Lattner
1afcace3a3 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
Chris Lattner
4f6bab98c5 Drop the "2" suffix on some enums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 18:17:37 +00:00
Chris Lattner
96a74c57d9 remove support for a bunch of obsolete instruction encodings
and other backward compatibility hacks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 18:09:11 +00:00
Chris Lattner
9d61dd9a08 Remove some "2" suffixes from the metadata enums now that "1" is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 17:50:30 +00:00
Chris Lattner
020a5a449f remove bitcode reader support for LLVM 2.7 metadata encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 17:48:53 +00:00
NAKAMURA Takumi
3bc729c3b3 llvm-bcanalyzer.cpp: Tweak format string to suppress warnings on mingw32-g++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 03:21:04 +00:00
Chris Lattner
354c5b9bcf fix dumping of METADATA_ATTACHMENT2 names, patch by Peter Housel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 05:50:01 +00:00
Michael J. Spencer
3ff9563c3e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:29:14 +00:00
Dan Gohman
e7e4b51afc Give CurStreamType's enum a name. This works around what is apparently
a bug in Apple GCC 4.0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 20:35:40 +00:00
Michael J. Spencer
333fb04506 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:48 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Dan Gohman
70c2fc0823 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 23:12:39 +00:00
Dan Gohman
0a6ee29aae Remove an unused command-line option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 17:20:51 +00:00
Dan Gohman
43906f920a Make llvm-bcanalyzer print out the full enum name for all metadata
code ids, not just some of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 18:28:07 +00:00
Chris Lattner
a6245247e9 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 02:17:50 +00:00
Chris Lattner
d3a5fa8e96 add a couple missing enum names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 01:05:24 +00:00
Chris Lattner
e73a31f667 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 06:49:46 +00:00
Daniel Dunbar
42985bbe38 Make llvm-bcanalyzer percentages more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 16:04:21 +00:00
Daniel Dunbar
80ba3d2c0b Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 16:03:57 +00:00
Duncan Sands
0cad4e3f0b Print INST_INBOUNDS_GEP rather than UnknownCode30.
Likewise for constant inbounds GEP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 12:28:37 +00:00