Skip to content

Commit 5d0fec6

Browse files
committed
Fixing up IRGenModule to handle changes in CodeGenOptions.
DisableFPElim was removed from CGO in cfe r366645. This change fixes the build for master-next.
1 parent e625d29 commit 5d0fec6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
9494

9595
auto &CGO = Importer->getClangCodeGenOpts();
9696
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);
98100
CGO.DiscardValueNames = !Opts.shouldProvideValueNames();
99101
switch (Opts.DebugInfoLevel) {
100102
case IRGenDebugInfoLevel::None:
@@ -895,12 +897,8 @@ bool swift::irgen::shouldRemoveTargetFeature(StringRef feature) {
895897
void IRGenModule::constructInitialFnAttributes(llvm::AttrBuilder &Attrs,
896898
OptimizationMode FuncOptMode) {
897899
// 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");
904902

905903
// Add target-cpu and target-features if they are non-null.
906904
auto *Clang = static_cast<ClangImporter *>(Context.getClangModuleLoader());

0 commit comments

Comments
 (0)