]> git.lizzy.rs Git - rust.git/commitdiff
enable fp-elim when debug info is disabled
authorDaniel Micay <danielmicay@gmail.com>
Tue, 28 Jan 2014 19:59:28 +0000 (14:59 -0500)
committerDaniel Micay <danielmicay@gmail.com>
Wed, 29 Jan 2014 21:35:05 +0000 (16:35 -0500)
This can almost be fully disabled, as it no longer breaks retrieving a
backtrace on OS X as verified by @alexcrichton. However, it still
breaks retrieving the values of parameters. This should be fixable in
the future via a proper location list...

Closes #7477

src/librustc/back/link.rs
src/librustc/lib/llvm.rs
src/rustllvm/PassWrapper.cpp
src/test/debug-info/function-prologue-stepping-no-split-stack.rs

index 63c4d9f4a2976ee270e7cdcdd50934fb41bb9d3e..bd5494ba4cd77521046f7d23b76584dadc6032e1 100644 (file)
@@ -128,6 +128,9 @@ pub fn run_passes(sess: Session,
             };
             let use_softfp = sess.opts.debugging_opts & session::USE_SOFTFP != 0;
 
+            // FIXME: #11906: Omitting frame pointers breaks retrieving the value of a parameter.
+            let no_fp_elim = sess.opts.debuginfo;
+
             let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| {
                 sess.opts.target_cpu.with_c_str(|CPU| {
                     sess.opts.target_feature.with_c_str(|Features| {
@@ -137,7 +140,8 @@ pub fn run_passes(sess: Session,
                             lib::llvm::RelocPIC,
                             OptLevel,
                             true,
-                            use_softfp
+                            use_softfp,
+                            no_fp_elim
                         )
                     })
                 })
index 3693b00951bcc84bacdfea7f51fe9b91c4d0fc0f..3ed59c0195eaca9b551a298c3954582e689b0042 100644 (file)
@@ -1728,7 +1728,8 @@ pub fn LLVMRustCreateTargetMachine(Triple: *c_char,
                                            Reloc: RelocMode,
                                            Level: CodeGenOptLevel,
                                            EnableSegstk: bool,
-                                           UseSoftFP: bool) -> TargetMachineRef;
+                                           UseSoftFP: bool,
+                                           NoFramePointerElim: bool) -> TargetMachineRef;
         pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
         pub fn LLVMRustAddAnalysisPasses(T: TargetMachineRef,
                                          PM: PassManagerRef,
index cab9c187eae0d7e2d286637e87fe6503aa470f00..2bc96d9f0bf718bad2b8670a2802b7dbb29643da 100644 (file)
@@ -68,7 +68,8 @@ LLVMRustCreateTargetMachine(const char *triple,
                             Reloc::Model RM,
                             CodeGenOpt::Level OptLevel,
                             bool EnableSegmentedStacks,
-                            bool UseSoftFloat) {
+                            bool UseSoftFloat,
+                            bool NoFramePointerElim) {
     std::string Error;
     Triple Trip(Triple::normalize(triple));
     const llvm::Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(),
@@ -79,7 +80,7 @@ LLVMRustCreateTargetMachine(const char *triple,
     }
 
     TargetOptions Options;
-    Options.NoFramePointerElim = true;
+    Options.NoFramePointerElim = NoFramePointerElim;
     Options.EnableSegmentedStacks = EnableSegmentedStacks;
     Options.FloatABIType = FloatABI::Default;
     Options.UseSoftFloat = UseSoftFloat;
index 4d940c91d2a4cb5db8a285e6c9471c124200df20..da2d4e09fc67f1521cc64ebcc221afa058ff7470 100644 (file)
@@ -244,6 +244,3 @@ fn main() {
     while_expr(40, 41, 42);
     loop_expr(43, 44, 45);
 }
-
-
-