summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-02-01 20:43:34 +0000
committerJames Y Knight <jyknight@google.com>2019-02-01 20:43:34 +0000
commitd9e85a0861b7e9320c34547a2ad7f49c504a9381 (patch)
treebafc31ff522534fb10e65ddc519943a7be7abc28 /llvm/unittests/IR
parent7976eb58382b25d0e17490b9d77fb06cb000c95b (diff)
downloadbcm5719-llvm-d9e85a0861b7e9320c34547a2ad7f49c504a9381.tar.gz
bcm5719-llvm-d9e85a0861b7e9320c34547a2ad7f49c504a9381.zip
[opaque pointer types] Pass function types to InvokeInst creation.
This cleans up all InvokeInst creation in LLVM to explicitly pass a function type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57171 llvm-svn: 352910
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/InstructionsTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/unittests/IR/InstructionsTest.cpp b/llvm/unittests/IR/InstructionsTest.cpp
index 1f82d4b632c..56a55e1f9e0 100644
--- a/llvm/unittests/IR/InstructionsTest.cpp
+++ b/llvm/unittests/IR/InstructionsTest.cpp
@@ -565,14 +565,15 @@ TEST(InstructionsTest, AlterCallBundles) {
TEST(InstructionsTest, AlterInvokeBundles) {
LLVMContext C;
Type *Int32Ty = Type::getInt32Ty(C);
- Type *FnTy = FunctionType::get(Int32Ty, Int32Ty, /*isVarArg=*/false);
+ FunctionType *FnTy = FunctionType::get(Int32Ty, Int32Ty, /*isVarArg=*/false);
Value *Callee = Constant::getNullValue(FnTy->getPointerTo());
Value *Args[] = {ConstantInt::get(Int32Ty, 42)};
std::unique_ptr<BasicBlock> NormalDest(BasicBlock::Create(C));
std::unique_ptr<BasicBlock> UnwindDest(BasicBlock::Create(C));
OperandBundleDef OldBundle("before", UndefValue::get(Int32Ty));
- std::unique_ptr<InvokeInst> Invoke(InvokeInst::Create(
- Callee, NormalDest.get(), UnwindDest.get(), Args, OldBundle, "result"));
+ std::unique_ptr<InvokeInst> Invoke(
+ InvokeInst::Create(FnTy, Callee, NormalDest.get(), UnwindDest.get(), Args,
+ OldBundle, "result"));
AttrBuilder AB;
AB.addAttribute(Attribute::Cold);
Invoke->setAttributes(
OpenPOWER on IntegriCloud