- Jan 19, 2014
-
-
Michael Gottesman authored
[APInt] Fix nearestLogBase2 to return correct answers for very large APInt and APInt with a bitwidth of 1. I also improved the comments, added some more tests, etc. llvm-svn: 199610
-
Michael Gottesman authored
This was due to arithmetic overflow in the getNumBits() computation. Now we cast BitWidth to a uint64_t so that does not occur during the computation. After the computation is complete, the uint64_t is truncated when the function returns. I know that this is not something that is likely to happen, but it *IS* a valid input and we should not blow up. llvm-svn: 199609
-
Chandler Carruth authored
This makes the 'verifyFunction' and 'verifyModule' functions totally independent operations on the LLVM IR. It also cleans up their API a bit by lifting the abort behavior into their clients and just using an optional raw_ostream parameter to control printing. The implementation of the verifier is now just an InstVisitor with no multiple inheritance. It also is significantly more const-correct, and hides the const violations internally. The two layers that force us to break const correctness are building a DomTree and dispatching through the InstVisitor. A new VerifierPass is used to implement the legacy pass manager interface in terms of the other pieces. The error messages produced may be slightly different now, and we may have slightly different short circuiting behavior with different usage models of the verifier, but generally everything works equivalently and this unblocks wiring the verifier up to the new pass manager. llvm-svn: 199569
-
- Jan 17, 2014
-
-
Rafael Espindola authored
llvm-svn: 199437
-
- Jan 16, 2014
-
-
Bill Wendling authored
Move copying of global initializers below the cloning of functions. The BlockAddress doesn't have access to the correct basic blocks until the functions have been cloned. This causes the BlockAddress to point to the old values. Just wait until the functions have been cloned before copying the initializers. PR13163 llvm-svn: 199354
-
- Jan 13, 2014
-
-
Rafael Espindola authored
llvm-svn: 199125
-
Chandler Carruth authored
can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. llvm-svn: 199104
-
Chandler Carruth authored
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
-
- Jan 12, 2014
-
-
Chandler Carruth authored
name to match the source file which I got earlier. Update the include sites. Also modernize the comments in the header to use the more recommended doxygen style. llvm-svn: 199041
-
- Jan 11, 2014
-
-
Chandler Carruth authored
mode that can be used to debug the execution of everything. No support for analyses here, that will come later. This already helps show parts of the opt commandline integration that isn't working. Tests of that will start using it as the bugs are fixed. llvm-svn: 199004
-
- Jan 10, 2014
-
-
Rafael Espindola authored
llvm-svn: 198955
-
- Jan 09, 2014
-
-
Rafael Espindola authored
I would not normally add tests like these, but the copy constructor is not used at all in our codebase with c++11, so having this tests might prevent breaking the c++03 build again. llvm-svn: 198886
-
- Jan 08, 2014
-
-
Rafael Espindola authored
llvm-svn: 198799
-
- Jan 07, 2014
-
-
Chandler Carruth authored
are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. llvm-svn: 198688
-
Chandler Carruth authored
subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
-
- Jan 05, 2014
-
-
Chandler Carruth authored
llvm-svn: 198552
-
Chandler Carruth authored
instructions. I needed this for a quick experiment I was making, and while I've no idea if that will ever get committed, I didn't want to throw away the pattern match code and for anyone else to have to write it again. I've added unittests to make sure this works correctly. In fun news, this also uncovered the IRBuilder bug. Doh! llvm-svn: 198541
-
Chandler Carruth authored
failed to correctly propagate the NUW and NSW flags to the constant folder for two instructions. I've added a unittest to cover flag propagation for the rest of the instructions and constant expressions. llvm-svn: 198538
-
Chandler Carruth authored
I'm adding next be a lot more readable. llvm-svn: 198534
-
Chandler Carruth authored
basic block to hold instructions, and managing all of their lifetimes in a fixture. This makes it easy to sink the expectations into the test cases themselves which also makes things a bit more explicit and clearer IMO. llvm-svn: 198532
-
- Jan 03, 2014
-
-
David Blaikie authored
llvm-svn: 198379
-
David Blaikie authored
This functionality was enabled by r198374. Here's a test to ensure it works and we don't regress it. Based on a patch by Maciej Piechotka. llvm-svn: 198377
-
David Blaikie authored
It was never specialized so let's just remove that unused configurability and always do the default. llvm-svn: 198374
-
- Jan 02, 2014
-
-
David Blaikie authored
Based on a patch by Maciej Piechotka. llvm-svn: 198334
-
David Blaikie authored
llvm-svn: 198330
-
Alp Toker authored
Suggested by Aaron Ballman. llvm-svn: 198288
-
- Jan 01, 2014
-
-
Alp Toker authored
Stopgap measure until we can just use static_assert(). llvm-svn: 198273
-
- Dec 30, 2013
-
-
Nico Weber authored
llvm-svn: 198198
-
- Dec 28, 2013
-
-
Nico Weber authored
llvm-svn: 198089
-
- Dec 27, 2013
-
-
Chandler Carruth authored
This is an iterator which you can build around a MemoryBuffer. It will iterate through the non-empty, non-comment lines of the buffer as a forward iterator. It should be small and reasonably fast (although it could be made much faster if anyone cares, I don't really...). This will be used to more simply support the text-based sample profile file format, and is largely based on the original patch by Diego. I've re-worked the style of it and separated it from the work of producing a MemoryBuffer from a file which both simplifies the interface and makes it easier to test. The style of the API follows the C++ standard naming conventions to fit in better with iterators in general, much like the Path and FileSystem interfaces follow standard-based naming conventions. llvm-svn: 198068
-
- Dec 25, 2013
-
-
NAKAMURA Takumi authored
llvm-svn: 198011
-
- Dec 20, 2013
-
-
NAKAMURA Takumi authored
llvm-svn: 197777
-
- Dec 19, 2013
-
-
Hans Wennborg authored
According to the docs, ThreadLocal<>::get() should return NULL if no object has been set. This patch makes that the case also for non-thread builds and adds a very basic unit test to check it. (This was causing PR18205 because PrettyStackTraceHead didn't get zero- initialized and we'd crash trying to read past the end of that list. We didn't notice this so much on Linux since we'd crash after printing all the entries, but on Mac we print into a SmallString, and would crash before printing that.) llvm-svn: 197718
-
NAKAMURA Takumi authored
Stray *Tests might stay after reverting. FIXME: Could we apply this feature to clang/unittests? FIXME: Implement this feature to CMake. llvm-svn: 197661
-
Rafael Espindola authored
It is also not clear what the value of the test was. The API is used from existing tools and can (and is) tested with lit. llvm-svn: 197654
-
Anna Zaks authored
llvm-svn: 197647
-
NAKAMURA Takumi authored
ArchiveFileDescriptorTests: Fix CMake build. Each unit test is expected to have suffix "*Tests" for lit gtest runner to seek one. llvm-svn: 197636
-
NAKAMURA Takumi authored
ArchiveFileDescriptorTests: Resurrect part of r197600, but make it invalidated, to appease buildbots. Please revert this several hours later ;) llvm-svn: 197635
-
- Dec 18, 2013
-
-
Owen Anderson authored
llvm-svn: 197602
-
Owen Anderson authored
llvm-svn: 197600
-