summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-131-1/+2
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. llvm-svn: 210920
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210783
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* [C++11] Use 'nullptr'.Craig Topper2014-06-083-9/+9
| | | | llvm-svn: 210442
* Use create methods since msvc doesn't handle delegating constructors.Rafael Espindola2014-05-171-1/+1
| | | | llvm-svn: 209076
* Reduce abuse of default values in the GlobalAlias constructor.Rafael Espindola2014-05-171-3/+1
| | | | | | This is in preparation for adding an optional offset. llvm-svn: 209073
* Fix most of PR10367.Rafael Espindola2014-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the design of GlobalAlias so that it doesn't take a ConstantExpr anymore. It now points directly to a GlobalObject, but its type is independent of the aliasee type. To avoid changing all alias related tests in this patches, I kept the common syntax @foo = alias i32* @bar to mean the same as now. The cases that used to use cast now use the more general syntax @foo = alias i16, i32* @bar. Note that GlobalAlias now behaves a bit more like GlobalVariable. We know that its type is always a pointer, so we omit the '*'. For the bitcode, a nice surprise is that we were writing both identical types already, so the format change is minimal. Auto upgrade is handled by looking through the casts and no new fields are needed for now. New bitcode will simply have different types for Alias and Aliasee. One last interesting point in the patch is that replaceAllUsesWith becomes smart enough to avoid putting a ConstantExpr in the aliasee. This seems better than checking and updating every caller. A followup patch will delete getAliasedGlobal now that it is redundant. Another patch will add support for an explicit offset. llvm-svn: 209007
* Change the GlobalAlias constructor to look a bit more like GlobalVariable.Rafael Espindola2014-05-161-2/+3
| | | | | | | This is part of the fix for pr10367. A GlobalAlias always has a pointer type, so just have the constructor build the type. llvm-svn: 208983
* This reverts r206828 until David has time to figure out that is going on.Quentin Colombet2014-04-221-25/+19
| | | | llvm-svn: 206839
* Use unique_ptr to handle ownership of Value*s in Cloning unit tests.David Blaikie2014-04-211-19/+25
| | | | llvm-svn: 206828
* CloneFunction: Clone all attributes, including the CCReid Kleckner2014-03-261-0/+23
| | | | | | | | | | | | | | | | Summary: Tested with a unit test because we don't appear to have any transforms that use this other than ASan, I think. Fixes PR17935. Reviewers: nicholas CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3194 llvm-svn: 204866
* DebugIRTests: Fixup for r204130.NAKAMURA Takumi2014-03-181-1/+1
| | | | llvm-svn: 204132
* [C++11] Change DebugInfoFinder to use range-based loopsAlon Mishne2014-03-181-2/+2
| | | | | | Also changes the iterators to return actual DI type over MDNode. llvm-svn: 204130
* unittests: Fix -Werror buildJustin Bogner2014-03-121-2/+2
| | | | llvm-svn: 203679
* Add parens around && clauses in a || to appease the compiler.Eli Bendersky2014-03-121-2/+2
| | | | | | Otherwise gcc 4.8.2 generates a warning. llvm-svn: 203671
* Cloning a function now also clones its debug metadata if ↵Alon Mishne2014-03-121-1/+211
| | | | | | 'ModuleLevelChanges' is true. llvm-svn: 203662
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-062-13/+14
| | | | | | | | | | 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
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-061-1/+1
| | | | | | already lives. llvm-svn: 203046
* [Layering] Move DIBuilder.h into the IR library where its implementationChandler Carruth2014-03-061-1/+1
| | | | | | already lives. llvm-svn: 203038
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-231-3/+4
| | | | | | | | | | | | | | | Before this patch they would take an boolean argument to say if the path already existed. This was redundant with the returned error_code which is able to represent that. This allowed for callers to incorrectly check only the existed flag instead of first checking the error code. Instead, pass in a boolean flag to say if the previous (non-)existence should be an error or not. Callers of the of the old simple versions are not affected. They still ignore the previous (non-)existence as they did before. llvm-svn: 201979
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-073-6/+5
| | | | | | | | | | 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
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-102-0/+4
| | | | llvm-svn: 196908
* [asan] rewrite asan's stack frame layoutKostya Serebryany2013-12-062-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Rewrite asan's stack frame layout. First, most of the stack layout logic is moved into a separte file to make it more testable and (potentially) useful for other projects. Second, make the frames more compact by using adaptive redzones (smaller for small objects, larger for large objects). Third, try to minimized gaps due to large alignments (this is hypothetical since today we don't see many stack vars aligned by more than 32). The frames indeed become more compact, but I'll still need to run more benchmarks before committing, but I am sking for review now to get early feedback. This change will be accompanied by a trivial change in compiler-rt tests to match the new frame sizes. Reviewers: samsonov, dvyukov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2324 llvm-svn: 196568
* Add support for software expansion of 64-bit integer division instructions.Michael Ilseman2013-11-191-0/+122
| | | | | | Patch by Dmitri Shtilman! llvm-svn: 195116
* Introduce SpecialCaseList::isIn overload for GlobalAliases.Peter Collingbourne2013-08-191-0/+46
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1437 llvm-svn: 188688
* Remove SpecialCaseList::findCategory.Peter Collingbourne2013-08-191-2/+0
| | | | | | It turned out that I didn't need this for DFSan. llvm-svn: 188646
* Relax conditions of test added in r188156 to fix it on WindowsAlexey Samsonov2013-08-121-1/+1
| | | | llvm-svn: 188157
* Introduce factory methods for SpecialCaseListAlexey Samsonov2013-08-121-2/+32
| | | | | | | | | | | | | | | | | | | | Summary: Doing work in constructors is bad: this change suggests to call SpecialCaseList::create(Path, Error) instead of "new SpecialCaseList(Path)". Currently the latter may crash with report_fatal_error, which is undesirable - sometimes we want to report the error to user gracefully - for example, if he provides an incorrect file as an argument of Clang's -fsanitize-blacklist flag. Reviewers: pcc Reviewed By: pcc CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1327 llvm-svn: 188156
* Make SpecialCaseList match full strings, as documented, using anchors.Peter Collingbourne2013-07-161-0/+16
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1149 llvm-svn: 186431
* Implement categories for special case lists.Peter Collingbourne2013-07-091-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | A special case list can now specify categories for specific globals, which can be used to instruct an instrumentation pass to treat certain functions or global variables in a specific way, such as by omitting certain aspects of instrumentation while keeping others, or informing the instrumentation pass that a specific uninstrumentable function has certain semantics, thus allowing the pass to instrument callers according to those semantics. For example, AddressSanitizer now uses the "init" category instead of global-init prefixes for globals whose initializers should not be instrumented, but which in all other respects should be instrumented. The motivating use case is DataFlowSanitizer, which will have a number of different categories for uninstrumentable functions, such as "functional" which specifies that a function has pure functional semantics, or "discard" which indicates that a function's return value should not be labelled. Differential Revision: http://llvm-reviews.chandlerc.com/D1092 llvm-svn: 185978
* Add some SpecialCaseList unit tests.Peter Collingbourne2013-07-092-0/+118
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1091 llvm-svn: 185977
* Replace UNIXy path with os-independent one in DebugIR unit testDaniel Malea2013-06-281-7/+8
| | | | | | - should resolve windows buildbot failure llvm-svn: 185232
* Fix Windows/Darwin build error in DebugIR unit testsDaniel Malea2013-06-281-9/+19
| | | | | | | - mistakenly used get_current_dir() linux function - replaced with getcwd/_getcwd as appropriate for current platform llvm-svn: 185225
* Adding tests for DebugIR passDaniel Malea2013-06-285-1/+320
| | | | | | | | | | - lit tests verify that each line of input LLVM IR gets a !dbg node and a corresponding entry of metadata that contains the line number - unit tests verify that DebugIR works as advertised in the interface - refactored some useful IR generation functionality from the MCJIT unit tests so it can be reused llvm-svn: 185212
* Delete the functions F1 and F2 to appease the valgrind bot.Joey Gouly2013-04-101-0/+3
| | | | llvm-svn: 179239
* Change CloneFunctionInto to always clone Argument attributes induvidually,Joey Gouly2013-04-101-1/+28
| | | | | | | rather than checking if the source and destination have the same number of arguments and copying the attributes over directly. llvm-svn: 179169
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-023-13/+13
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Sort the #include lines for unittest/...Chandler Carruth2012-12-043-9/+8
| | | | llvm-svn: 169250
* Remove unneeded and invalid SetInsertPoint calls from unittest.Benjamin Kramer2012-09-261-8/+0
| | | | | | BB->end() returns a sentinel value that is not a legal insert point. llvm-svn: 164699
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-261-0/+96
| | | | | | | | and u/srem. Fixed issue with Release build. llvm-svn: 164654
* Revert r164614 to appease the buildbots.Chad Rosier2012-09-251-97/+0
| | | | llvm-svn: 164627
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-251-0/+97
| | | | | | and u/srem. llvm-svn: 164614
* Unit tests for IntegerDivision. Currently, just a basic sanity check to ↵Michael Ilseman2012-09-252-0/+55
| | | | | | ensure that the code was generated properly. Future work would be finding some way to test the actual result that would be computed. llvm-svn: 164582
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-291-2/+3
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
* llvm/unittests: Simplify LINK_COMPONENTS.NAKAMURA Takumi2012-06-211-1/+1
| | | | llvm-svn: 158942
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-212-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. llvm-svn: 158909
* Fix inappropriate use of anonymous namespaces in unittests.Chandler Carruth2012-06-201-1/+3
| | | | | | | | | | | The TEST_F macros actually declare *subclasses* of the test fixtures. Even if they didn't we don't want them to declare external functions. The entire unit test, including both the fixture class and the fixture test cases should be wrapped in the anonymous namespace. This issue was caught by the new '-Winternal-linkage-in-inline' warning. llvm-svn: 158798
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-251-1/+1
| | | | llvm-svn: 135904
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-0/+1
| | | | llvm-svn: 129271
OpenPOWER on IntegriCloud