@@ -94,7 +94,9 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
94
94
95
95
auto &CGO = Importer->getClangCodeGenOpts ();
96
96
CGO.OptimizationLevel = Opts.shouldOptimize () ? 3 : 0 ;
97
- CGO.DisableFPElim = Opts.DisableFPElim ;
97
+ CGO.setFramePointer (Opts.DisableFPElim
98
+ ? clang::CodeGenOptions::FramePointerKind::All
99
+ : clang::CodeGenOptions::FramePointerKind::None);
98
100
CGO.DiscardValueNames = !Opts.shouldProvideValueNames ();
99
101
switch (Opts.DebugInfoLevel ) {
100
102
case IRGenDebugInfoLevel::None:
@@ -895,12 +897,8 @@ bool swift::irgen::shouldRemoveTargetFeature(StringRef feature) {
895
897
void IRGenModule::constructInitialFnAttributes (llvm::AttrBuilder &Attrs,
896
898
OptimizationMode FuncOptMode) {
897
899
// Add DisableFPElim.
898
- if (!IRGen.Opts .DisableFPElim ) {
899
- Attrs.addAttribute (" no-frame-pointer-elim" , " false" );
900
- } else {
901
- Attrs.addAttribute (" no-frame-pointer-elim" , " true" );
902
- Attrs.addAttribute (" no-frame-pointer-elim-non-leaf" );
903
- }
900
+ Attrs.addAttribute (" frame-pointer" ,
901
+ IRGen.Opts .DisableFPElim ? " all" : " none" );
904
902
905
903
// Add target-cpu and target-features if they are non-null.
906
904
auto *Clang = static_cast <ClangImporter *>(Context.getClangModuleLoader ());
0 commit comments