Skip to content

Commit 20d5c42

Browse files
committedMar 28, 2021
Revert "OpaquePtr: Turn inalloca into a type attribute"
This reverts commit 4fefed6. Broke check-clang everywhere.
1 parent 821547c commit 20d5c42

File tree

91 files changed

+264
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+264
-446
lines changed
 

‎clang/lib/CodeGen/CGCall.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ void CodeGenModule::ConstructAttributeList(
22902290
// Attach attributes to inalloca argument.
22912291
if (IRFunctionArgs.hasInallocaArg()) {
22922292
llvm::AttrBuilder Attrs;
2293-
Attrs.addInAllocaAttr(FI.getArgStruct());
2293+
Attrs.addAttribute(llvm::Attribute::InAlloca);
22942294
ArgAttrs[IRFunctionArgs.getInallocaArgNo()] =
22952295
llvm::AttributeSet::get(getLLVMContext(), Attrs);
22962296
}

‎clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ void usage() {
1616
bar(f);
1717
}
1818

19-
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z"(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>) %0)
19+
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z"(<{ %struct.Foo }>* inalloca %0)
2020
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
2121
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
2222
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
2323
// WINDOWS: ret i32 %[[LOAD]]
2424

25-
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>) %0)
25+
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.sse4.2"(<{ %struct.Foo }>* inalloca %0)
2626
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
2727
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
2828
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
2929
// WINDOWS: %[[ADD:[0-9a-zA-Z]+]] = add nsw i32 %[[LOAD]], 1
3030
// WINDOWS: ret i32 %[[ADD]]
3131

32-
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>) %0)
32+
// WINDOWS: define dso_local i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* inalloca %0)
3333
// WINDOWS: %[[O:[0-9a-zA-Z]+]] = getelementptr inbounds <{ %struct.Foo }>, <{ %struct.Foo }>* %0, i32 0, i32 0
3434
// WINDOWS: %[[X:[0-9a-zA-Z]+]] = getelementptr inbounds %struct.Foo, %struct.Foo* %[[O]], i32 0, i32 0
3535
// WINDOWS: %[[LOAD:[0-9a-zA-Z]+]] = load i32, i32* %[[X]]
@@ -39,7 +39,7 @@ void usage() {
3939
// WINDOWS: define dso_local void @"?usage@@YAXXZ"()
4040
// WINDOWS: %[[F:[0-9a-zA-Z]+]] = alloca %struct.Foo
4141
// WINDOWS: %[[ARGMEM:[0-9a-zA-Z]+]] = alloca inalloca <{ %struct.Foo }>
42-
// WINDOWS: %[[CALL:[0-9a-zA-Z]+]] = call i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>* inalloca(<{ %struct.Foo }>) %[[ARGMEM]])
42+
// WINDOWS: %[[CALL:[0-9a-zA-Z]+]] = call i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>* inalloca %[[ARGMEM]])
4343

4444
// WINDOWS: define weak_odr dso_local i32 @"?bar@@YAHUFoo@@@Z.resolver"(<{ %struct.Foo }>* %0)
4545
// WINDOWS: %[[RET:[0-9a-zA-Z]+]] = musttail call i32 @"?bar@@YAHUFoo@@@Z.arch_ivybridge"(<{ %struct.Foo }>* %0)

0 commit comments

Comments
 (0)
Please sign in to comment.