Skip to content

Commit 8546e43

Browse files
Merge pull request swiftlang#63518 from aschwaighofer/frame-pointer-non-leaf
IRGen: Change to using frame-pointer=non-leaf for functions that request no framepointer
2 parents cd2d983 + d785202 commit 8546e43

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ bool swift::irgen::shouldRemoveTargetFeature(StringRef feature) {
13101310
}
13111311

13121312
void IRGenModule::setHasNoFramePointer(llvm::AttrBuilder &Attrs) {
1313-
Attrs.addAttribute("frame-pointer", "none");
1313+
Attrs.addAttribute("frame-pointer", "non-leaf");
13141314
}
13151315

13161316
void IRGenModule::setHasNoFramePointer(llvm::Function *F) {

test/IRGen/default_function_ir_attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,6 @@ func test_computed_key_path_generic_thunks<T: P0 & Hashable>(value: T) -> KeyPat
171171
// unlikely that handrolled code generation would think to add one.
172172
// CHECK: attributes [[ATTRS_SIMPLE]] = { [[CUSTOM_ATTRS:.*target-cpu.*]] }{{$}}
173173
// CHECK-DAG: attributes [[ATTRS_NOINLINE_NOUNWIND]] = { noinline nounwind {{.*target-cpu.*}} }
174-
// CHECK-DAG: attributes [[ATTRS_NOINLINE_READNONE_NOUNWIND_NOFRAME]] = { noinline nounwind readnone {{.*}}"frame-pointer"="none"{{.*target-cpu.*}} }
175-
// CHECK-DAG: attributes [[ATTRS_NOINLINE_READONLY_NOUNWIND_NOFRAME]] = { noinline nounwind readonly willreturn {{.*}}"frame-pointer"="none"{{.*target-cpu.*}} }
174+
// CHECK-DAG: attributes [[ATTRS_NOINLINE_READNONE_NOUNWIND_NOFRAME]] = { noinline nounwind readnone {{.*}}"frame-pointer"="non-leaf"{{.*target-cpu.*}} }
175+
// CHECK-DAG: attributes [[ATTRS_NOINLINE_READONLY_NOUNWIND_NOFRAME]] = { noinline nounwind readonly willreturn {{.*}}"frame-pointer"="non-leaf"{{.*target-cpu.*}} }
176176
// CHECK-DAG: attributes [[ATTRS_NOUNWIND]] = { nounwind [[CUSTOM_ATTRS]] }{{$}}

0 commit comments

Comments
 (0)