[llvm] a7f183a - [Orc] Fix sret/byval attributes in test (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 11:47:30 PDT 2021
Author: Nikita Popov
Date: 2021-07-20T20:47:15+02:00
New Revision: a7f183afe7cc792c50d64b3b9ea22269c87ec35f
URL: https://github.com/llvm/llvm-project/commit/a7f183afe7cc792c50d64b3b9ea22269c87ec35f
DIFF: https://github.com/llvm/llvm-project/commit/a7f183afe7cc792c50d64b3b9ea22269c87ec35f.diff
LOG: [Orc] Fix sret/byval attributes in test (NFC)
This was placing sret/byval attributes without type argument on
non-pointer arguments. Make this valid IR by using pointer
arguments and passing the corresponding attribute type argument.
Added:
Modified:
llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp
index e9d39efd344f2..860fc2f73feb3 100644
--- a/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp
@@ -18,17 +18,17 @@ namespace {
TEST(IndirectionUtilsTest, MakeStub) {
LLVMContext Context;
ModuleBuilder MB(Context, "x86_64-apple-macosx10.10", "");
+ StructType *ArgTy = getDummyStructTy(Context);
+ Type *ArgPtrTy = PointerType::getUnqual(ArgTy);
FunctionType *FTy = FunctionType::get(
- Type::getVoidTy(Context),
- {getDummyStructTy(Context), getDummyStructTy(Context)}, false);
+ Type::getVoidTy(Context), {ArgPtrTy, ArgPtrTy}, false);
Function *F = MB.createFunctionDecl(FTy, "");
AttributeSet FnAttrs = AttributeSet::get(
Context, AttrBuilder().addAttribute(Attribute::NoUnwind));
AttributeSet RetAttrs; // None
AttributeSet ArgAttrs[2] = {
- AttributeSet::get(Context,
- AttrBuilder().addAttribute(Attribute::StructRet)),
- AttributeSet::get(Context, AttrBuilder().addAttribute(Attribute::ByVal)),
+ AttributeSet::get(Context, AttrBuilder().addStructRetAttr(ArgTy)),
+ AttributeSet::get(Context, AttrBuilder().addByValAttr(ArgTy)),
};
F->setAttributes(AttributeList::get(Context, FnAttrs, RetAttrs, ArgAttrs));
More information about the llvm-commits
mailing list