aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/IRBuilderTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-09-02Fix a logic bug when copying fast-math flags.Sanjay Patel1-0/+4
"Setting" does not equal "copying". This bug has sat dormant for 2 reasons: 1. The unit test was not adequate. 2. Every current user of the "copyFastMathFlags" API is operating on a new instruction. (ie, all existing fast-math flags are off). If you copy flags to an existing instruction that has some flags on already, you will not necessarily turn them off as expected. I uncovered this bug while trying to implement a fix for PR20802. llvm-svn: 216939
2014-06-08[C++11] Use 'nullptr'.Craig Topper1-5/+5
llvm-svn: 210442
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-3/+2
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-03-04[Modules] Move the NoFolder into the IR library as it createsChandler Carruth1-1/+1
instructions. llvm-svn: 202834
2014-02-25Fix resetting the DataLayout in a Module.Rafael Espindola1-0/+8
No tool does this currently, but as everything else in a module we should be able to change its DataLayout. Most of the fix is in DataLayout to make sure it can be reset properly. The test uses Module::setDataLayout since the fact that we mutate a DataLayout is an implementation detail. The module could hold a OwningPtr<DataLayout> and the DataLayout itself could be immutable. Thanks to Philip Reames for pushing me in the right direction. llvm-svn: 202198
2014-01-05Fix a bug in IRBuilder that's been there for who knows how long. ItChandler Carruth1-0/+51
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
2013-12-05Use present fast-math flags when applicable in CreateBinOpMichael Ilseman1-0/+7
We were previously not adding fast-math flags through CreateBinOp() when it happened to be making a floating point binary operator. This patch updates it to do so similarly to directly calling CreateF*(). llvm-svn: 196438
2013-11-15Give unit test its own LLVMContext so MDNodes aren't leaked even if we never ↵Benjamin Kramer1-9/+10
call llvm_shutdown. Found by valgrind. llvm-svn: 194797
2013-10-05Silencing an MSVC warning.Aaron Ballman1-2/+2
llvm-svn: 192042
2013-09-30IRBuilder: Add RAII objects to reset insertion points or fast math flags.Benjamin Kramer1-0/+36
Inspired by the object from the SLPVectorizer. This found a minor bug in the debug loc restoration in the vectorizer where the location of a following instruction was attached instead of the location from the original instruction. llvm-svn: 191673
2013-01-23IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not ↵NAKAMURA Takumi1-0/+1
linked. llvm-svn: 173238
2013-01-23IRTests/IRBuilderTest.cpp: Let GV added to the module.NAKAMURA Takumi1-2/+2
It fixes --vg-leak. llvm-svn: 173237
2013-01-07Rename the VMCore unittest tree to IR. Somehow was missed when doing theChandler Carruth1-0/+184
library rename. llvm-svn: 171747