aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/InstructionsTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini1-11/+15
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
2016-01-15[InstructionsTest] delete via unique_ptr (NFC)Joseph Tremoulet1-10/+6
Summary: Simplify the memory management of mock IR in test AlterInvokeBundles. Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16211 llvm-svn: 257892
2016-01-14InstructionsTest.cpp: Fix a warning. [-Wsign-compare]NAKAMURA Takumi1-1/+1
llvm-svn: 257752
2016-01-14[UnitTest] Fix warning, NFC.Joseph Tremoulet1-1/+1
Use an unsigned literal to avoid signedness mismatch in the compare. llvm-svn: 257747
2016-01-14[OperandBundles] Copy DebugLoc with calls/invokesJoseph Tremoulet1-2/+61
Summary: The overloads of CallInst::Create and InvokeInst::Create that are used to adjust operand bundles purport to create a new instruction "identical in every way except [for] the operand bundles", so copy the DebugLoc along with everything else. Reviewers: sanjoy, majnemer Subscribers: majnemer, dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D16157 llvm-svn: 257745
2015-03-14[opaque pointer type] gep API migrationDavid Blaikie1-10/+12
This concludes the GetElementPtrInst::Create migration, thus marking the beginning of the IRBuilder::CreateGEP* migration to come. llvm-svn: 232280
2015-03-10DataLayout is mandatory, update the API to reflect it with references.Mehdi Amini1-4/+4
Summary: Now that the DataLayout is a mandatory part of the module, let's start cleaning the codebase. This patch is a first attempt at doing that. This patch is not exactly NFC as for instance some places were passing a nullptr instead of the DataLayout, possibly just because there was a default value on the DataLayout argument to many functions in the API. Even though it is not purely NFC, there is no change in the validation. I turned as many pointer to DataLayout to references, this helped figuring out all the places where a nullptr could come up. I had initially a local version of this patch broken into over 30 independant, commits but some later commit were cleaning the API and touching part of the code modified in the previous commits, so it seemed cleaner without the intermediate state. Test Plan: Reviewers: echristo Subscribers: llvm-commits From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231740
2014-06-08[C++11] Use 'nullptr'.Craig Topper1-8/+8
llvm-svn: 210442
2014-05-06Copy the full TailCallKind in CallInst::clone_implReid Kleckner1-0/+33
Split from the musttail inliner change. This will be covered by an opt test when the inliner change lands. llvm-svn: 208126
2014-03-27Untabify.NAKAMURA Takumi1-3/+3
llvm-svn: 204916
2014-03-27SmallVector<3> may be used here.NAKAMURA Takumi1-1/+1
llvm-svn: 204915
2014-03-27IRTests/InstructionsTest.cpp: Avoid initializer list.NAKAMURA Takumi1-4/+4
llvm-svn: 204914
2014-03-26Add a unit test for Invoke iteration, similar to the one for CallEli Bendersky1-11/+40
The tests are refactored to use the same fixture. llvm-svn: 204860
2014-03-26Fix bot breakage in InstructionsTest.Eli Bendersky1-1/+1
Makes sure the Call dies before the Function llvm-svn: 204856
2014-03-26Fix problem with r204836Eli Bendersky1-0/+26
In CallInst, op_end() points at the callee, which we don't want to iterate over when just iterating over arguments. Now take this into account when returning a iterator_range from arg_operands. Similar reasoning for InvokeInst. Also adds a unit test to verify this actually works as expected. llvm-svn: 204851
2014-03-02[C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer1-2/+2
Remove the old functions. llvm-svn: 202636
2014-01-22Bug 18228 - Fix accepting bitcasts between vectors of pointers with aMatt Arsenault1-0/+16
different number of elements. Bitcasts were passing with vectors of pointers with different number of elements since the number of elements was checking SrcTy->getVectorNumElements() == SrcTy->getVectorNumElements() which isn't helpful. The addrspacecast was also wrong, but that case at least is caught by the verifier. Refactor bitcast and addrspacecast handling in castIsValid to be more readable and fix this problem. llvm-svn: 199821
2013-12-13Use a: and s: instead of a0: and s0: in the DataLayout strings.Rafael Espindola1-2/+2
They are equivalent and the size of 'a' and 's' is unused. llvm-svn: 197259
2013-11-15Add addrspacecast instruction.Matt Arsenault1-39/+14
Patch by Michele Scandale! llvm-svn: 194760
2013-07-31Fix ptr vector inconsistency in CreatePointerCastMatt Arsenault1-0/+11
One form would accept a vector of pointers, and the other did not. Make both accept vectors of pointers, and add an assertion for the number of elements. llvm-svn: 187464
2013-07-30Respect address space sizes in isEliminableCastPair.Matt Arsenault1-2/+79
This avoids constant folding bitcast/ptrtoint/inttoptr combinations that have illegal bitcasts between differently sized address spaces. llvm-svn: 187455
2013-07-30Revert "Remove isCastable since nothing uses it now"Matt Arsenault1-0/+5
Apparently dragonegg uses it. llvm-svn: 187454
2013-07-30Remove isCastable since nothing uses it nowMatt Arsenault1-5/+0
llvm-svn: 187448
2013-07-30Change behavior of calling bitcasted alias functions.Matt Arsenault1-7/+70
It will now only convert the arguments / return value and call the underlying function if the types are able to be bitcasted. This avoids using fp<->int conversions that would occur before. llvm-svn: 187444
2013-06-28Fix copypaste error in test.Matt Arsenault1-1/+1
Thename says it's an i32*, but it was actually creating another i8* llvm-svn: 185239
2013-01-31Change GetPointerBaseWithConstantOffset's DataLayout argument from aDan Gohman1-4/+4
reference to a pointer, so that it can handle the case where DataLayout is not available and behave conservatively. llvm-svn: 174024
2013-01-16A test for r172535.Evgeniy Stepanov1-0/+8
llvm-svn: 172614
2013-01-07Rename the VMCore unittest tree to IR. Somehow was missed when doing theChandler Carruth1-0/+284
library rename. llvm-svn: 171747