]> git.lizzy.rs Git - rust.git/commitdiff
Consolidate codegen-related compiler flags
authorAlex Crichton <alex@alexcrichton.com>
Fri, 7 Feb 2014 03:57:09 +0000 (19:57 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 10 Feb 2014 08:50:39 +0000 (00:50 -0800)
Move them all behind a new -C switch. This migrates some -Z flags and some
top-level flags behind this -C codegen option.

The -C flag takes values of the form "-C name=value" where the "=value" is
optional for some flags.

Flags affected:

* --llvm-args           => -C llvm-args
* --passes              => -C passes
* --ar                  => -C ar
* --linker              => -C linker
* --link-args           => -C link-args
* --target-cpu          => -C target-cpu
* --target-feature      => -C target-fature
* --android-cross-path  => -C android-cross-path
* --save-temps          => -C save-temps
* --no-rpath            => -C no-rpath
* -Z no-prepopulate     => -C no-prepopulate-passes
* -Z no-vectorize-loops => -C no-vectorize-loops
* -Z no-vectorize-slp   => -C no-vectorize-slp
* -Z soft-float         => -C soft-float
* -Z gen-crate-map      => -C gen-crate-map
* -Z prefer-dynamic     => -C prefer-dynamic
* -Z no-integrated-as   => -C no-integrated-as

As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g
or --debuginfo flag.

* -Z debug-info         => removed
* -Z extra-debug-info   => -g or --debuginfo

Closes #9770
Closes #12000

112 files changed:
Makefile.in
man/rustc.1
mk/platform.mk
mk/tests.mk
src/compiletest/runtest.rs
src/doc/rust.md
src/librustc/back/link.rs
src/librustc/back/lto.rs
src/librustc/driver/driver.rs
src/librustc/driver/session.rs
src/librustc/lib.rs
src/librustc/middle/trans/_match.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/context.rs
src/librustc/middle/trans/controlflow.rs
src/librustc/middle/trans/debuginfo.rs
src/librustdoc/test.rs
src/test/compile-fail/issue-10755.rs
src/test/compile-fail/issue-11154.rs
src/test/debug-info/basic-types-metadata.rs
src/test/debug-info/basic-types.rs
src/test/debug-info/borrowed-basic.rs
src/test/debug-info/borrowed-c-style-enum.rs
src/test/debug-info/borrowed-enum.rs
src/test/debug-info/borrowed-managed-basic.rs
src/test/debug-info/borrowed-struct.rs
src/test/debug-info/borrowed-tuple.rs
src/test/debug-info/borrowed-unique-basic.rs
src/test/debug-info/box.rs
src/test/debug-info/boxed-struct.rs
src/test/debug-info/boxed-vec.rs
src/test/debug-info/by-value-non-immediate-argument.rs
src/test/debug-info/by-value-self-argument-in-trait-impl.rs
src/test/debug-info/c-style-enum-in-composite.rs
src/test/debug-info/c-style-enum.rs
src/test/debug-info/closure-in-generic-function.rs
src/test/debug-info/destructured-fn-argument.rs
src/test/debug-info/destructured-local.rs
src/test/debug-info/evec-in-struct.rs
src/test/debug-info/function-arg-initialization.rs
src/test/debug-info/function-arguments.rs
src/test/debug-info/function-prologue-stepping-no-split-stack.rs
src/test/debug-info/generic-function.rs
src/test/debug-info/generic-functions-nested.rs
src/test/debug-info/generic-method-on-generic-struct.rs
src/test/debug-info/generic-static-method-on-struct-and-enum.rs
src/test/debug-info/generic-struct-style-enum.rs
src/test/debug-info/generic-struct.rs
src/test/debug-info/generic-trait-generic-static-default-method.rs
src/test/debug-info/generic-tuple-style-enum.rs
src/test/debug-info/include_string.rs
src/test/debug-info/issue11600.rs
src/test/debug-info/lexical-scope-in-for-loop.rs
src/test/debug-info/lexical-scope-in-if.rs
src/test/debug-info/lexical-scope-in-match.rs
src/test/debug-info/lexical-scope-in-parameterless-closure.rs
src/test/debug-info/lexical-scope-in-stack-closure.rs
src/test/debug-info/lexical-scope-in-unconditional-loop.rs
src/test/debug-info/lexical-scope-in-unique-closure.rs
src/test/debug-info/lexical-scope-in-while.rs
src/test/debug-info/lexical-scope-with-macro.rs
src/test/debug-info/lexical-scopes-in-block-expression.rs
src/test/debug-info/managed-enum.rs
src/test/debug-info/managed-pointer-within-unique-vec.rs
src/test/debug-info/managed-pointer-within-unique.rs
src/test/debug-info/method-on-enum.rs
src/test/debug-info/method-on-generic-struct.rs
src/test/debug-info/method-on-struct.rs
src/test/debug-info/method-on-trait.rs
src/test/debug-info/method-on-tuple-struct.rs
src/test/debug-info/multiple-functions-equal-var-names.rs
src/test/debug-info/multiple-functions.rs
src/test/debug-info/name-shadowing-and-scope-nesting.rs
src/test/debug-info/nil-enum.rs
src/test/debug-info/option-like-enum.rs
src/test/debug-info/packed-struct-with-destructor.rs
src/test/debug-info/packed-struct.rs
src/test/debug-info/recursive-enum.rs
src/test/debug-info/recursive-struct.rs
src/test/debug-info/self-in-default-method.rs
src/test/debug-info/self-in-generic-default-method.rs
src/test/debug-info/shadowed-argument.rs
src/test/debug-info/shadowed-variable.rs
src/test/debug-info/simple-lexical-scope.rs
src/test/debug-info/simple-struct.rs
src/test/debug-info/simple-tuple.rs
src/test/debug-info/static-method-on-struct-and-enum.rs
src/test/debug-info/struct-in-enum.rs
src/test/debug-info/struct-in-struct.rs
src/test/debug-info/struct-style-enum.rs
src/test/debug-info/struct-with-destructor.rs
src/test/debug-info/trait-generic-static-default-method.rs
src/test/debug-info/trait-pointers.rs
src/test/debug-info/tuple-in-struct.rs
src/test/debug-info/tuple-in-tuple.rs
src/test/debug-info/tuple-struct.rs
src/test/debug-info/tuple-style-enum.rs
src/test/debug-info/unique-enum.rs
src/test/debug-info/var-captured-in-nested-closure.rs
src/test/debug-info/var-captured-in-sendable-closure.rs
src/test/debug-info/var-captured-in-stack-closure.rs
src/test/debug-info/vec-slices.rs
src/test/debug-info/vec.rs
src/test/run-make/bootstrap-from-c-with-green/Makefile
src/test/run-make/bootstrap-from-c-with-native/Makefile
src/test/run-make/c-link-to-rust-staticlib/Makefile
src/test/run-make/lto-smoke-c/Makefile
src/test/run-make/mixing-deps/Makefile
src/test/run-make/prefer-dylib/Makefile
src/test/run-make/prune-link-args/Makefile
src/test/run-pass/issue-7712.rs

index 05b62157de9b5be692c671babafb41c363023630..49e02a63b7dfb675b750111d5f7fad5317659a60 100644 (file)
@@ -141,7 +141,7 @@ endif
 # worry about the distribution of one file (with its native dynamic
 # dependencies)
 RUSTFLAGS_STAGE0 += -Z prefer-dynamic
-RUSTFLAGS_STAGE1 += -Z prefer-dynamic
+RUSTFLAGS_STAGE1 += -C prefer-dynamic
 
 # platform-specific auto-configuration
 include $(CFG_SRC_DIR)mk/platform.mk
index 0f84c26df2b02c5090859d235aed122ed1d0a271..8dc795cfd3e1b3d3fdee31bcd41605d60df5cd48 100644 (file)
@@ -27,18 +27,15 @@ Display this message
 \fB\-L\fR PATH
 Add a directory to the library search path
 .TP
-\fB\-\-linker\fR LINKER
-Program to use for linking instead of the default
-.TP
-\fB\-\-link-args\fR FLAGS
-A space-separated list of flags passed to the linker
-.TP
 \fB\-\-ls\fR
 List the symbols defined by a library crate
 .TP
 \fB\-\-no\-trans\fR
 Run all passes except translation; no output
 .TP
+\fB\-g\fR, \fB\-\-debuginfo\fR
+Emit DWARF debug information into object files generated.
+.TP
 \fB\-O\fR
 Equivalent to \fI\-\-opt\-level=2\fR
 .TP
@@ -48,11 +45,6 @@ Write output to <filename>. Ignored if more than one --emit is specified.
 \fB\-\-opt\-level\fR LEVEL
 Optimize with possible levels 0-3
 .TP
-\fB\-\-passes\fR NAMES
-Comma- or space-separated list of optimization passes. Overrides
-the default passes for the optimization level. A value of 'list'
-will list the available passes.
-.TP
 \fB\-\-out\-dir\fR DIR
 Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
 (default the current directory)
@@ -66,9 +58,6 @@ Pretty-print the input instead of compiling; valid types are: normal
 expanded, with type annotations), or identified (fully parenthesized,
 AST nodes and blocks with IDs)
 .TP
-\fB\-\-save\-temps\fR
-Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
-.TP
 \fB\-\-sysroot\fR PATH
 Override the system root
 .TP
@@ -80,12 +69,6 @@ Target triple cpu-manufacturer-kernel[-os] to compile for (see
 http://sources.redhat.com/autobook/autobook/autobook_17.html
 for details)
 .TP
-\fB\-\-target-feature\fR TRIPLE
-Target-specific attributes (see llc -mattr=help for details)
-.TP
-\fB\-\-android-cross-path\fR PATH
-The path to the Android NDK
-.TP
 \fB\-W\fR help
 Print 'lint' options and default settings
 .TP
@@ -104,9 +87,80 @@ Set lint forbidden
 \fB\-Z\fR FLAG
 Set internal debugging options. Use "-Z help" to print available options.
 .TP
+\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
+Set a codegen-related flag to the value specifie.d Use "-C help" to print
+available flags. See CODEGEN OPTIONS below
+.TP
 \fB\-v\fR, \fB\-\-version\fR
 Print version info and exit
 
+.SH CODEGEN OPTIONS
+
+.TP
+\fBar\fR=/path/to/ar
+Path to the archive utility to use when assembling archives.
+.TP
+\fBlinker\fR=/path/to/cc
+Path to the linker utility to use when linking libraries, executables, and
+objects.
+.TP
+\fBlink-args\fR='-flag1 -flag2'
+A space-separated list of extra arguments to pass to the linker when the linker
+is invoked.
+.TP
+\fBtarget-cpu\fR=help
+Selects a target processor. If the value is 'help', then a list of available
+cpus is printed.
+.TP
+\fBtarget-feature\fR='+feature1 -feature2'
+A space-separated list of features to enable or disable for the target. A
+preceding '+' enables a feature while a preceding '-' disables it. Available
+features can be discovered through target-cpu=help.
+.TP
+\fBpasses\fR=list
+A space-separated list of extra LLVM passes to run. A value of 'list' will
+cause rustc to print all known passes and exit. The passes specified are
+appended at the end of the normal pass manager.
+.TP
+\fBllvm-args\fR='-arg1 -arg2'
+A space-separted list of argument to pass through to LLVM.
+.TP
+\fBsave-temps\fR
+If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
+throughout compilation in the output directory.
+.TP
+\fBandroid-cross-path\fR=path/to/ndk/bin
+Directory to find the Android NDK cross-compilation tools
+.TP
+\fBno-rpath\fR
+If specified, then the rpath value for dynamic libraries will not be set in
+either dynamic library or executable outputs.
+.TP
+\fBno-prepopulate-passes\fR
+Suppresses pre-population of the LLVM pass manager that is run over the module.
+.TP
+\fBno-vectorize-loops\fR
+Suppresses running the loop vectorization LLVM pass, regardless of optimization
+level.
+.TP
+\fBno-vectorize-slp\fR
+Suppresses running the LLVM SLP vectorization pass, regardless of optimization
+level.
+.TP
+\fBsoft-float\fR
+Generates software floating point library calls instead of hardware
+instructions.
+.TP
+\fBgen-crate-map\fR
+Forces generate of a toplevel crate map. May be required for logging to work
+when rust is embedded into another application.
+.TP
+\fBprefer-dynamic\fR
+Prefers dynamic linking to static linking.
+.TP
+\fBno-integrated-as\fR
+Force usage of an external assembler rather than LLVM's integrated one.
+
 .SH "EXAMPLES"
 To build an executable from a source file with a main function:
     $ rustc -o hello hello.rs
@@ -117,8 +171,8 @@ To build a library from a source file:
 To build either with a crate (.rs) file:
     $ rustc hello.rs
 
-To build an executable with debug info (experimental):
-    $ rustc -Z debug-info -o hello hello.rs
+To build an executable with debug info:
+    $ rustc -g -o hello hello.rs
 
 .SH "SEE ALSO"
 
index f400809b616bf09ff53a3fcdf06c5feed103256a..5a69013892c9675402c8871ae4aa2daadd05008c 100644 (file)
@@ -300,8 +300,8 @@ CFG_PATH_MUNGE_arm-linux-androideabi := true
 CFG_LDPATH_arm-linux-androideabi :=
 CFG_RUN_arm-linux-androideabi=
 CFG_RUN_TARG_arm-linux-androideabi=
-RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
-RUSTC_CROSS_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
+RUSTC_FLAGS_arm-linux-androideabi :=-android-cross-path=$(CFG_ANDROID_CROSS_PATH)
+RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-android-cross-path=$(CFG_ANDROID_CROSS_PATH)
 
 # arm-unknown-linux-gnueabihf configuration
 CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-
index d2fccbd47cf8bfd36dd22fe9b66876ea6562dddb..3fe2f8b69cbf5585203f5fdeb77545efcce71a03 100644 (file)
@@ -530,7 +530,7 @@ CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
 
 # There's no need our entire test suite to take up gigabytes of space on disk
 # including copies of libstd/libextra all over the place
-CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -Z prefer-dynamic
+CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -C prefer-dynamic
 
 # The tests can not be optimized while the rest of the compiler is optimized, so
 # filter out the optimization (if any) from rustc and then figure out if we need
index 8edd923390af4fed74c542de94885ecd1d303c2c..f906c0fc4e10fb6581ed374572f37a7178b37048 100644 (file)
@@ -332,8 +332,8 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
             let args = split_maybe_args(&config.rustcflags);
             let mut tool_path:~str = ~"";
             for arg in args.iter() {
-                if arg.contains("--android-cross-path=") {
-                    tool_path = arg.replace("--android-cross-path=","");
+                if arg.contains("android-cross-path=") {
+                    tool_path = arg.replace("android-cross-path=","");
                     break;
                 }
             }
@@ -1054,7 +1054,7 @@ fn compile_test_and_save_bitcode(config: &config, props: &TestProps,
     let aux_dir = aux_output_dir_name(config, testfile);
     // FIXME (#9639): This needs to handle non-utf8 paths
     let link_args = ~[~"-L", aux_dir.as_str().unwrap().to_owned()];
-    let llvm_args = ~[~"--emit=obj", ~"--crate-type=lib", ~"--save-temps"];
+    let llvm_args = ~[~"--emit=obj", ~"--crate-type=lib", ~"-C", ~"save-temps"];
     let args = make_compile_args(config, props,
                                  link_args + llvm_args,
                                  |a, b| ThisFile(make_o_name(a, b)), testfile);
index bae8f562af526f7ea947ac949bfe090702f22894..725f15f4aaad9b0dfb4ca0189580423e24b6ddb7 100644 (file)
@@ -3761,7 +3761,7 @@ dependencies will be used:
    with the above limitations in dynamic and static libraries, it is required
    for all upstream dependencies to be in the same format. The next question is
    whether to prefer a dynamic or a static format. The compiler currently favors
-   static linking over dynamic linking, but this can be inverted with the `-Z
+   static linking over dynamic linking, but this can be inverted with the `-C
    prefer-dynamic` flag to the compiler.
 
    What this means is that first the compiler will attempt to find all upstream
index 531b8bf9034579a8b69a1c28fbbef4d46df707e2..d6abc7b6954d31a7c04e37f280fa1148cad4b5cd 100644 (file)
@@ -111,13 +111,13 @@ pub mod write {
     fn target_feature<'a>(sess: &'a Session) -> &'a str {
         match sess.targ_cfg.os {
             abi::OsAndroid => {
-                if "" == sess.opts.target_feature {
+                if "" == sess.opts.cg.target_feature {
                     "+v7"
                 } else {
-                    sess.opts.target_feature.as_slice()
+                    sess.opts.cg.target_feature.as_slice()
                 }
             }
-            _ => sess.opts.target_feature.as_slice()
+            _ => sess.opts.cg.target_feature.as_slice()
         }
     }
 
@@ -130,7 +130,7 @@ pub fn run_passes(sess: Session,
         unsafe {
             configure_llvm(sess);
 
-            if sess.opts.save_temps {
+            if sess.opts.cg.save_temps {
                 output.with_extension("no-opt.bc").with_c_str(|buf| {
                     llvm::LLVMWriteBitcodeToFile(llmod, buf);
                 })
@@ -142,7 +142,7 @@ pub fn run_passes(sess: Session,
               session::Default => lib::llvm::CodeGenLevelDefault,
               session::Aggressive => lib::llvm::CodeGenLevelAggressive,
             };
-            let use_softfp = sess.opts.debugging_opts & session::USE_SOFTFP != 0;
+            let use_softfp = sess.opts.cg.soft_float;
 
             // FIXME: #11906: Omitting frame pointers breaks retrieving the value of a parameter.
             // FIXME: #11954: mac64 unwinding may not work with fp elim
@@ -151,7 +151,7 @@ pub fn run_passes(sess: Session,
                               sess.targ_cfg.arch == abi::X86_64);
 
             let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| {
-                sess.opts.target_cpu.with_c_str(|CPU| {
+                sess.opts.cg.target_cpu.with_c_str(|CPU| {
                     target_feature(&sess).with_c_str(|Features| {
                         llvm::LLVMRustCreateTargetMachine(
                             T, CPU, Features,
@@ -180,13 +180,13 @@ pub fn run_passes(sess: Session,
             };
             if !sess.no_verify() { assert!(addpass("verify")); }
 
-            if !sess.no_prepopulate_passes() {
+            if !sess.opts.cg.no_prepopulate_passes {
                 llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
                 llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
                 populate_llvm_passes(fpm, mpm, llmod, OptLevel);
             }
 
-            for pass in sess.opts.custom_passes.iter() {
+            for pass in sess.opts.cg.passes.iter() {
                 pass.with_c_str(|s| {
                     if !llvm::LLVMRustAddPass(mpm, s) {
                         sess.warn(format!("unknown pass {}, ignoring", *pass));
@@ -208,7 +208,7 @@ pub fn run_passes(sess: Session,
             // emitting an rlib. Whenever an rlib is created, the bytecode is
             // inserted into the archive in order to allow LTO against it.
             let crate_types = sess.crate_types.borrow();
-            if sess.opts.save_temps ||
+            if sess.opts.cg.save_temps ||
                (crate_types.get().contains(&session::CrateTypeRlib) &&
                 sess.opts.output_types.contains(&OutputTypeExe)) {
                 output.temp_path(OutputTypeBitcode).with_c_str(|buf| {
@@ -220,7 +220,7 @@ pub fn run_passes(sess: Session,
                 time(sess.time_passes(), "all lto passes", (), |()|
                      lto::run(sess, llmod, tm, trans.reachable));
 
-                if sess.opts.save_temps {
+                if sess.opts.cg.save_temps {
                     output.with_extension("lto.bc").with_c_str(|buf| {
                         llvm::LLVMWriteBitcodeToFile(llmod, buf);
                     })
@@ -353,10 +353,10 @@ unsafe fn configure_llvm(sess: Session) {
 
         // Copy what clang does by turning on loop vectorization at O2 and
         // slp vectorization at O3
-        let vectorize_loop = !sess.no_vectorize_loops() &&
+        let vectorize_loop = !sess.opts.cg.no_vectorize_loops &&
                              (sess.opts.optimize == session::Default ||
                               sess.opts.optimize == session::Aggressive);
-        let vectorize_slp = !sess.no_vectorize_slp() &&
+        let vectorize_slp = !sess.opts.cg.no_vectorize_slp &&
                             sess.opts.optimize == session::Aggressive;
 
         let mut llvm_c_strs = ~[];
@@ -374,7 +374,7 @@ unsafe fn configure_llvm(sess: Session) {
         if sess.time_llvm_passes() { add("-time-passes"); }
         if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
 
-        for arg in sess.opts.llvm_args.iter() {
+        for arg in sess.opts.cg.llvm_args.iter() {
             add(*arg);
         }
 
@@ -745,7 +745,7 @@ pub fn output_lib_filename(lm: &LinkMeta) -> ~str {
 }
 
 pub fn get_cc_prog(sess: Session) -> ~str {
-    match sess.opts.linker {
+    match sess.opts.cg.linker {
         Some(ref linker) => return linker.to_owned(),
         None => {}
     }
@@ -763,7 +763,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
 }
 
 pub fn get_ar_prog(sess: Session) -> ~str {
-    match sess.opts.ar {
+    match sess.opts.cg.ar {
         Some(ref ar) => return ar.to_owned(),
         None => {}
     }
@@ -773,7 +773,7 @@ pub fn get_ar_prog(sess: Session) -> ~str {
 
 fn get_system_tool(sess: Session, tool: &str) -> ~str {
     match sess.targ_cfg.os {
-        abi::OsAndroid => match sess.opts.android_cross_path {
+        abi::OsAndroid => match sess.opts.cg.android_cross_path {
             Some(ref path) => {
                 let tool_str = match tool {
                     "cc" => "gcc",
@@ -783,7 +783,7 @@ fn get_system_tool(sess: Session, tool: &str) -> ~str {
             }
             None => {
                 sess.fatal(format!("need Android NDK path for the '{}' tool \
-                                    (--android-cross-path)", tool))
+                                    (-android-cross-path)", tool))
             }
         },
         _ => tool.to_owned(),
@@ -813,7 +813,7 @@ pub fn link_binary(sess: Session,
     }
 
     // Remove the temporary object file and metadata if we aren't saving temps
-    if !sess.opts.save_temps {
+    if !sess.opts.cg.save_temps {
         let obj_filename = outputs.temp_path(OutputTypeObject);
         if !sess.opts.output_types.contains(&OutputTypeObject) {
             remove(sess, &obj_filename);
@@ -969,7 +969,7 @@ fn link_rlib(sess: Session,
             // into the archive.
             let bc = obj_filename.with_extension("bc");
             a.add_file(&bc, false);
-            if !sess.opts.save_temps &&
+            if !sess.opts.cg.save_temps &&
                !sess.opts.output_types.contains(&OutputTypeBitcode) {
                 remove(sess, &bc);
             }
@@ -1142,7 +1142,7 @@ fn link_args(sess: Session,
             args.push(~"-dynamiclib");
             args.push(~"-Wl,-dylib");
             // FIXME (#9639): This needs to handle non-utf8 paths
-            if !sess.opts.no_rpath {
+            if !sess.opts.cg.no_rpath {
                 args.push(~"-Wl,-install_name,@rpath/" +
                           out_filename.filename_str().unwrap());
             }
@@ -1163,13 +1163,13 @@ fn link_args(sess: Session,
     // FIXME (#2397): At some point we want to rpath our guesses as to
     // where extern libraries might live, based on the
     // addl_lib_search_paths
-    if !sess.opts.no_rpath {
+    if !sess.opts.cg.no_rpath {
         args.push_all(rpath::get_rpath_flags(sess, out_filename));
     }
 
     // Finally add all the linker arguments provided on the command line along
     // with any #[link_args] attributes found inside the crate
-    args.push_all(sess.opts.linker_args);
+    args.push_all(sess.opts.cg.link_args);
     let used_link_args = sess.cstore.get_used_link_args();
     let used_link_args = used_link_args.borrow();
     for arg in used_link_args.get().iter() {
@@ -1235,7 +1235,7 @@ fn unlib(config: @session::Config, stem: &str) -> ~str {
     }
 
     let cstore = sess.cstore;
-    if !dylib && !sess.prefer_dynamic() {
+    if !dylib && !sess.opts.cg.prefer_dynamic {
         // With an executable, things get a little interesting. As a limitation
         // of the current implementation, we require that everything must be
         // static or everything must be dynamic. The reasons for this are a
index 3c7d804435f2fdb2d76bf8a6f26cdd8ba0275175..b2440dcedbdcb6a52e1794898d0e7b88bc8523f4 100644 (file)
@@ -19,7 +19,7 @@
 
 pub fn run(sess: session::Session, llmod: ModuleRef,
            tm: TargetMachineRef, reachable: &[~str]) {
-    if sess.prefer_dynamic() {
+    if sess.opts.cg.prefer_dynamic {
         sess.err("cannot prefer dynamic linking when performing LTO");
         sess.note("only 'staticlib' and 'bin' outputs are supported with LTO");
         sess.abort_if_errors();
index 0d45d5bdbab436333041ff76d218a754bfa1c148..15240897b2aee9d99372dfee1187d8a648bada7e 100644 (file)
@@ -382,7 +382,7 @@ pub fn phase_4_translate_to_llvm(sess: Session,
 pub fn phase_5_run_llvm_passes(sess: Session,
                                trans: &CrateTranslation,
                                outputs: &OutputFilenames) {
-    if sess.no_integrated_as() {
+    if sess.opts.cg.no_integrated_as {
         let output_type = link::OutputTypeAssembly;
 
         time(sess.time_passes(), "LLVM passes", (), |_|
@@ -391,7 +391,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
         link::write::run_assembler(sess, outputs);
 
         // Remove assembly source, unless --save-temps was specified
-        if !sess.opts.save_temps {
+        if !sess.opts.cg.save_temps {
             fs::unlink(&outputs.temp_path(link::OutputTypeAssembly)).unwrap();
         }
     } else {
@@ -747,7 +747,6 @@ pub fn build_session_options(binary: ~str,
     let parse_only = matches.opt_present("parse-only");
     let no_trans = matches.opt_present("no-trans");
     let no_analysis = matches.opt_present("no-analysis");
-    let no_rpath = matches.opt_present("no-rpath");
 
     let lint_levels = [lint::allow, lint::warn,
                        lint::deny, lint::forbid];
@@ -817,9 +816,6 @@ pub fn build_session_options(binary: ~str,
 
     let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::new(m));
     let target = matches.opt_str("target").unwrap_or(host_triple());
-    let target_cpu = matches.opt_str("target-cpu").unwrap_or(~"generic");
-    let target_feature = matches.opt_str("target-feature").unwrap_or(~"");
-    let save_temps = matches.opt_present("save-temps");
     let opt_level = {
         if (debugging_opts & session::NO_OPT) != 0 {
             No
@@ -841,85 +837,77 @@ pub fn build_session_options(binary: ~str,
         } else { No }
     };
     let gc = debugging_opts & session::GC != 0;
-    let extra_debuginfo = debugging_opts & session::EXTRA_DEBUG_INFO != 0;
-    let debuginfo = debugging_opts & session::DEBUG_INFO != 0 ||
-        extra_debuginfo;
+    let debuginfo = matches.opt_present("g") || matches.opt_present("debuginfo");
 
     let addl_lib_search_paths = matches.opt_strs("L").map(|s| {
         Path::new(s.as_slice())
     }).move_iter().collect();
-    let ar = matches.opt_str("ar");
-    let linker = matches.opt_str("linker");
-    let linker_args = matches.opt_strs("link-args").flat_map( |a| {
-        a.split(' ').filter_map(|arg| {
-            if arg.is_empty() {
-                None
-            } else {
-                Some(arg.to_owned())
-            }
-        }).collect()
-    });
 
     let cfg = parse_cfgspecs(matches.opt_strs("cfg"));
     let test = matches.opt_present("test");
-    let android_cross_path = matches.opt_str("android-cross-path");
     let write_dependency_info = (matches.opt_present("dep-info"),
                                  matches.opt_str("dep-info").map(|p| Path::new(p)));
 
-    let custom_passes = match matches.opt_str("passes") {
-        None => ~[],
-        Some(s) => {
-            s.split(|c: char| c == ' ' || c == ',').map(|s| {
-                s.trim().to_owned()
-            }).collect()
-        }
-    };
-    let llvm_args = match matches.opt_str("llvm-args") {
-        None => ~[],
-        Some(s) => {
-            s.split(|c: char| c == ' ' || c == ',').map(|s| {
-                s.trim().to_owned()
-            }).collect()
-        }
-    };
     let print_metas = (matches.opt_present("crate-id"),
                        matches.opt_present("crate-name"),
                        matches.opt_present("crate-file-name"));
+    let cg = build_codegen_options(matches);
 
     let sopts = @session::Options {
         crate_types: crate_types,
         gc: gc,
         optimize: opt_level,
-        custom_passes: custom_passes,
-        llvm_args: llvm_args,
         debuginfo: debuginfo,
-        extra_debuginfo: extra_debuginfo,
         lint_opts: lint_opts,
-        save_temps: save_temps,
         output_types: output_types,
         addl_lib_search_paths: @RefCell::new(addl_lib_search_paths),
-        ar: ar,
-        linker: linker,
-        linker_args: linker_args,
         maybe_sysroot: sysroot_opt,
         target_triple: target,
-        target_cpu: target_cpu,
-        target_feature: target_feature,
         cfg: cfg,
         binary: binary,
         test: test,
         parse_only: parse_only,
         no_trans: no_trans,
         no_analysis: no_analysis,
-        no_rpath: no_rpath,
         debugging_opts: debugging_opts,
-        android_cross_path: android_cross_path,
         write_dependency_info: write_dependency_info,
         print_metas: print_metas,
+        cg: cg,
     };
     return sopts;
 }
 
+pub fn build_codegen_options(matches: &getopts::Matches)
+        -> session::CodegenOptions
+{
+    let mut cg = session::basic_codegen_options();
+    for option in matches.opt_strs("C").move_iter() {
+        let mut iter = option.splitn('=', 1);
+        let key = iter.next().unwrap();
+        let value = iter.next();
+        let option_to_lookup = key.replace("-", "_");
+        let mut found = false;
+        for &(candidate, setter, _) in session::CG_OPTIONS.iter() {
+            if option_to_lookup.as_slice() != candidate { continue }
+            if !setter(&mut cg, value) {
+                match value {
+                    Some(..) => early_error(format!("codegen option `{}` takes \
+                                                     no value", key)),
+                    None => early_error(format!("codegen option `{0}` requires \
+                                                 a value (-C {0}=<value>)",
+                                                key))
+                }
+            }
+            found = true;
+            break;
+        }
+        if !found {
+            early_error(format!("unknown codegen option: `{}`", key));
+        }
+    }
+    return cg;
+}
+
 pub fn build_session(sopts: @session::Options,
                      local_crate_source_file: Option<Path>)
                      -> Session {
@@ -1002,15 +990,12 @@ pub fn optgroups() -> ~[getopts::OptGroup] {
   optmulti("", "emit", "Comma separated list of types of output for the compiler
                         to emit",
            "[asm|bc|ir|obj|link]"),
-  optopt("", "linker", "Program to use for linking instead of the default.", "LINKER"),
-  optopt("", "ar", "Program to use for managing archives instead of the default.", "AR"),
   optflag("", "crate-id", "Output the crate id and exit"),
   optflag("", "crate-name", "Output the crate name and exit"),
   optflag("", "crate-file-name", "Output the file(s) that would be written if compilation \
           continued and exit"),
-  optmulti("",  "link-args", "FLAGS is a space-separated list of flags
-                            passed to the linker", "FLAGS"),
   optflag("",  "ls",  "List the symbols defined by a library crate"),
+  optflag("g",  "debuginfo",  "Emit DWARF debug info to the objects created"),
   optflag("", "no-trans",
                         "Run all passes except translation; no output"),
   optflag("", "no-analysis",
@@ -1020,13 +1005,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] {
   optopt("o", "",     "Write output to <filename>", "FILENAME"),
   optopt("", "opt-level",
                         "Optimize with possible levels 0-3", "LEVEL"),
-  optopt("", "passes", "Comma or space separated list of pass names to use. \
-                        Appends to the default list of passes to run for the \
-                        specified current optimization level. A value of \
-                        \"list\" will list all of the available passes", "NAMES"),
-  optopt("", "llvm-args", "A list of arguments to pass to llvm, comma \
-                           separated", "ARGS"),
-  optflag("", "no-rpath", "Disables setting the rpath in libs/exes"),
   optopt( "",  "out-dir",
                         "Write output to compiler-chosen filename
                           in <dir>", "DIR"),
@@ -1041,9 +1019,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] {
                           AST nodes and blocks with IDs)", "TYPE"),
   optflagopt("", "dep-info",
                         "Output dependency info to <filename> after compiling", "FILENAME"),
-  optflag("", "save-temps",
-                        "Write intermediate files (.bc, .opt.bc, .o)
-                          in addition to normal output"),
   optopt("", "sysroot",
                         "Override the system root", "PATH"),
   optflag("", "test", "Build a test harness"),
@@ -1051,14 +1026,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] {
                         "Target triple cpu-manufacturer-kernel[-os]
                           to compile for (see chapter 3.4 of http://www.sourceware.org/autobook/
                           for details)", "TRIPLE"),
-  optopt("", "target-cpu",
-                        "Select target processor (llc -mcpu=help
-                          for details)", "CPU"),
-  optopt("", "target-feature",
-                        "Target specific attributes (llc -mattr=help
-                          for details)", "FEATURE"),
-  optopt("", "android-cross-path",
-         "The path to the Android NDK", "PATH"),
   optmulti("W", "warn",
                         "Set lint warnings", "OPT"),
   optmulti("A", "allow",
@@ -1067,6 +1034,8 @@ pub fn optgroups() -> ~[getopts::OptGroup] {
                         "Set lint denied", "OPT"),
   optmulti("F", "forbid",
                         "Set lint forbidden", "OPT"),
+  optmulti("C", "codegen",
+                        "Set a codegen option", "OPT[=VALUE]"),
   optmulti("Z", "",   "Set internal debugging options", "FLAG"),
   optflag( "v", "version",
                         "Print version info and exit"),
index dc8598c10d0d05d91c99ccb996a37426162c9797..27b8e681666058c51fafd71acaea3f4f2a081088 100644 (file)
@@ -65,17 +65,8 @@ macro_rules! debugging_opts(
         META_STATS,
         NO_OPT,
         GC,
-        DEBUG_INFO,
-        EXTRA_DEBUG_INFO,
         PRINT_LINK_ARGS,
         PRINT_LLVM_PASSES,
-        NO_VECTORIZE_LOOPS,
-        NO_VECTORIZE_SLP,
-        NO_PREPOPULATE_PASSES,
-        USE_SOFTFP,
-        GEN_CRATE_MAP,
-        PREFER_DYNAMIC,
-        NO_INTEGRATED_AS,
         LTO
     ]
     0
@@ -104,26 +95,9 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, u64)] {
      ("print-link-args", "Print the arguments passed to the linker",
       PRINT_LINK_ARGS),
      ("gc", "Garbage collect shared data (experimental)", GC),
-     ("extra-debug-info", "Extra debugging info (experimental)",
-      EXTRA_DEBUG_INFO),
-     ("debug-info", "Produce debug info (experimental)", DEBUG_INFO),
      ("print-llvm-passes",
       "Prints the llvm optimization passes being run",
       PRINT_LLVM_PASSES),
-     ("no-prepopulate-passes",
-      "Don't pre-populate the pass managers with a list of passes, only use \
-        the passes from --passes",
-      NO_PREPOPULATE_PASSES),
-     ("no-vectorize-loops",
-      "Don't run the loop vectorization optimization passes",
-      NO_VECTORIZE_LOOPS),
-     ("no-vectorize-slp", "Don't run LLVM's SLP vectorization passes",
-      NO_VECTORIZE_SLP),
-     ("soft-float", "Generate software floating point library calls", USE_SOFTFP),
-     ("gen-crate-map", "Force generation of a toplevel crate map", GEN_CRATE_MAP),
-     ("prefer-dynamic", "Prefer dynamic linking to static linking", PREFER_DYNAMIC),
-     ("no-integrated-as",
-      "Use external assembler rather than LLVM's integrated one", NO_INTEGRATED_AS),
      ("lto", "Perform LLVM link-time optimizations", LTO),
     ]
 }
@@ -144,24 +118,15 @@ pub struct Options {
 
     gc: bool,
     optimize: OptLevel,
-    custom_passes: ~[~str],
-    llvm_args: ~[~str],
     debuginfo: bool,
-    extra_debuginfo: bool,
     lint_opts: ~[(lint::Lint, lint::level)],
-    save_temps: bool,
     output_types: ~[back::link::OutputType],
     // This was mutable for rustpkg, which updates search paths based on the
     // parsed code. It remains mutable in case its replacements wants to use
     // this.
     addl_lib_search_paths: @RefCell<HashSet<Path>>,
-    ar: Option<~str>,
-    linker: Option<~str>,
-    linker_args: ~[~str],
     maybe_sysroot: Option<@Path>,
     target_triple: ~str,
-    target_cpu: ~str,
-    target_feature: ~str,
     // User-specified cfg meta items. The compiler itself will add additional
     // items to the crate config, and during parsing the entire crate config
     // will be added to the crate AST node.  This should not be used for
@@ -172,13 +137,12 @@ pub struct Options {
     parse_only: bool,
     no_trans: bool,
     no_analysis: bool,
-    no_rpath: bool,
     debugging_opts: u64,
-    android_cross_path: Option<~str>,
     /// Whether to write dependency files. It's (enabled, optional filename).
     write_dependency_info: (bool, Option<Path>),
     /// Crate id-related things to maybe print. It's (crate_id, crate_name, crate_file_name).
     print_metas: (bool, bool, bool),
+    cg: CodegenOptions,
 }
 
 // The type of entry function, so
@@ -329,24 +293,6 @@ pub fn borrowck_stats(&self) -> bool { self.debugging_opt(BORROWCK_STATS) }
     pub fn print_llvm_passes(&self) -> bool {
         self.debugging_opt(PRINT_LLVM_PASSES)
     }
-    pub fn no_prepopulate_passes(&self) -> bool {
-        self.debugging_opt(NO_PREPOPULATE_PASSES)
-    }
-    pub fn no_vectorize_loops(&self) -> bool {
-        self.debugging_opt(NO_VECTORIZE_LOOPS)
-    }
-    pub fn no_vectorize_slp(&self) -> bool {
-        self.debugging_opt(NO_VECTORIZE_SLP)
-    }
-    pub fn gen_crate_map(&self) -> bool {
-        self.debugging_opt(GEN_CRATE_MAP)
-    }
-    pub fn prefer_dynamic(&self) -> bool {
-        self.debugging_opt(PREFER_DYNAMIC)
-    }
-    pub fn no_integrated_as(&self) -> bool {
-        self.debugging_opt(NO_INTEGRATED_AS)
-    }
     pub fn lto(&self) -> bool {
         self.debugging_opt(LTO)
     }
@@ -381,35 +327,132 @@ pub fn basic_options() -> @Options {
         crate_types: ~[],
         gc: false,
         optimize: No,
-        custom_passes: ~[],
-        llvm_args: ~[],
         debuginfo: false,
-        extra_debuginfo: false,
         lint_opts: ~[],
-        save_temps: false,
         output_types: ~[],
         addl_lib_search_paths: @RefCell::new(HashSet::new()),
-        ar: None,
-        linker: None,
-        linker_args: ~[],
         maybe_sysroot: None,
         target_triple: host_triple(),
-        target_cpu: ~"generic",
-        target_feature: ~"",
         cfg: ~[],
         binary: ~"rustc",
         test: false,
         parse_only: false,
         no_trans: false,
         no_analysis: false,
-        no_rpath: false,
         debugging_opts: 0,
-        android_cross_path: None,
         write_dependency_info: (false, None),
         print_metas: (false, false, false),
+        cg: basic_codegen_options(),
     }
 }
 
+/// Declare a macro that will define all CodegenOptions fields and parsers all
+/// at once. The goal of this macro is to define an interface that can be
+/// programmatically used by the option parser in order to initialize the struct
+/// without hardcoding field names all over the place.
+///
+/// The goal is to invoke this macro once with the correct fields, and then this
+/// macro generates all necessary code. The main gotcha of this macro is the
+/// cgsetters module which is a bunch of generated code to parse an option into
+/// its respective field in the struct. There are a few hand-written parsers for
+/// parsing specific types of values in this module.
+macro_rules! cgoptions(
+    ($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
+(
+    #[deriving(Clone)]
+    pub struct CodegenOptions { $($opt: $t),* }
+
+    pub fn basic_codegen_options() -> CodegenOptions {
+        CodegenOptions { $($opt: $init),* }
+    }
+
+    pub type CodegenSetter = fn(&mut CodegenOptions, v: Option<&str>) -> bool;
+    pub static CG_OPTIONS: &'static [(&'static str, CodegenSetter,
+                                      &'static str)] =
+        &[ $( (stringify!($opt), cgsetters::$opt, $desc) ),* ];
+
+    mod cgsetters {
+        use super::CodegenOptions;
+
+        $(
+            pub fn $opt(cg: &mut CodegenOptions, v: Option<&str>) -> bool {
+                $parse(&mut cg.$opt, v)
+            }
+        )*
+
+        fn parse_bool(slot: &mut bool, v: Option<&str>) -> bool {
+            match v {
+                Some(..) => false,
+                None => { *slot = true; true }
+            }
+        }
+
+        fn parse_opt_string(slot: &mut Option<~str>, v: Option<&str>) -> bool {
+            match v {
+                Some(s) => { *slot = Some(s.to_owned()); true },
+                None => false,
+            }
+        }
+
+        fn parse_string(slot: &mut ~str, v: Option<&str>) -> bool {
+            match v {
+                Some(s) => { *slot = s.to_owned(); true },
+                None => false,
+            }
+        }
+
+        fn parse_list(slot: &mut ~[~str], v: Option<&str>) -> bool {
+            match v {
+                Some(s) => {
+                    for s in s.words() {
+                        slot.push(s.to_owned());
+                    }
+                    true
+                },
+                None => false,
+            }
+        }
+
+    }
+) )
+
+cgoptions!(
+    ar: Option<~str> = (None, parse_opt_string,
+        "tool to assemble archives with"),
+    linker: Option<~str> = (None, parse_opt_string,
+        "system linker to link outputs with"),
+    link_args: ~[~str] = (~[], parse_list,
+        "extra arguments to pass to the linker (space separated)"),
+    target_cpu: ~str = (~"generic", parse_string,
+        "select target processor (llc -mcpu=help for details)"),
+    target_feature: ~str = (~"", parse_string,
+        "target specific attributes (llc -mattr=help for details)"),
+    passes: ~[~str] = (~[], parse_list,
+        "a list of extra LLVM passes to run (space separated)"),
+    llvm_args: ~[~str] = (~[], parse_list,
+        "a list of arguments to pass to llvm (space separated)"),
+    save_temps: bool = (false, parse_bool,
+        "save all temporary output files during compilation"),
+    android_cross_path: Option<~str> = (None, parse_opt_string,
+        "the path to the Android NDK"),
+    no_rpath: bool = (false, parse_bool,
+        "disables setting the rpath in libs/exes"),
+    no_prepopulate_passes: bool = (false, parse_bool,
+        "don't pre-populate the pass manager with a list of passes"),
+    no_vectorize_loops: bool = (false, parse_bool,
+        "don't run the loop vectorization optimization passes"),
+    no_vectorize_slp: bool = (false, parse_bool,
+        "don't run LLVM's SLP vectorization pass"),
+    soft_float: bool = (false, parse_bool,
+        "generate software floating point library calls"),
+    gen_crate_map: bool = (false, parse_bool,
+        "force generation of a toplevel crate map"),
+    prefer_dynamic: bool = (false, parse_bool,
+        "prefer dynamic linking to static linking"),
+    no_integrated_as: bool = (false, parse_bool,
+        "use an external assembler rather than LLVM's integrated one"),
+)
+
 // Seems out of place, but it uses session, so I'm putting it here
 pub fn expect<T:Clone>(sess: Session, opt: Option<T>, msg: || -> ~str) -> T {
     diagnostic::expect(sess.diagnostic(), opt, msg)
index edcefdf659402613359978eeab870faf2812c338..1b575e96df6eeb50db38f60075c92248a54616ae 100644 (file)
@@ -168,7 +168,7 @@ pub fn describe_warnings() {
     fn padded(max: uint, s: &str) -> ~str {
         " ".repeat(max - s.len()) + s
     }
-    println!("{}", "\nAvailable lint checks:\n"); // FIXME: #9970
+    println!("\nAvailable lint checks:\n");
     println!("    {}  {:7.7s}  {}",
              padded(max_key, "name"), "default", "meaning");
     println!("    {}  {:7.7s}  {}\n",
@@ -184,7 +184,7 @@ fn padded(max: uint, s: &str) -> ~str {
 }
 
 pub fn describe_debug_flags() {
-    println!("{}", "\nAvailable debug options:\n"); // FIXME: #9970
+    println!("\nAvailable debug options:\n");
     let r = session::debugging_opts_map();
     for tuple in r.iter() {
         match *tuple {
@@ -195,6 +195,22 @@ pub fn describe_debug_flags() {
     }
 }
 
+pub fn describe_codegen_flags() {
+    println!("\nAvailable codegen options:\n");
+    let mut cg = session::basic_codegen_options();
+    for &(name, parser, desc) in session::CG_OPTIONS.iter() {
+        // we invoke the parser function on `None` to see if this option needs
+        // an argument or not.
+        let (width, extra) = if parser(&mut cg, None) {
+            (25, "")
+        } else {
+            (21, "=val")
+        };
+        println!("    -C {:>width$s}{} -- {}", name.replace("_", "-"),
+                 extra, desc, width=width);
+    }
+}
+
 pub fn run_compiler(args: &[~str]) {
     let mut args = args.to_owned();
     let binary = args.shift().unwrap();
@@ -227,7 +243,13 @@ pub fn run_compiler(args: &[~str]) {
         return;
     }
 
-    if matches.opt_str("passes") == Some(~"list") {
+    let cg_flags = matches.opt_strs("C");
+    if cg_flags.iter().any(|x| x == &~"help") {
+        describe_codegen_flags();
+        return;
+    }
+
+    if cg_flags.contains(&~"passes=list") {
         unsafe { lib::llvm::llvm::LLVMRustPrintPasses(); }
         return;
     }
index f49b0f1af08b3dc3c41264f05fc07c3811a5ebcd..8828fd5e01914bdd899435864745b7ef1ec6aa22 100644 (file)
@@ -1371,7 +1371,7 @@ fn insert_lllocals<'a>(bcx: &'a Block<'a>,
             llmap.get().insert(binding_info.id, datum);
         }
 
-        if bcx.sess().opts.extra_debuginfo {
+        if bcx.sess().opts.debuginfo {
             debuginfo::create_match_binding_metadata(bcx,
                                                      ident,
                                                      binding_info.id,
@@ -2030,7 +2030,7 @@ pub fn store_arg<'a>(mut bcx: &'a Block<'a>,
             // like `x: T`
             let arg_ty = node_id_type(bcx, pat.id);
             if type_of::arg_is_indirect(bcx.ccx(), arg_ty)
-                && !bcx.ccx().sess.opts.extra_debuginfo {
+                && !bcx.ccx().sess.opts.debuginfo {
                 // Don't copy an indirect argument to an alloca, the caller
                 // already put it in a temporary alloca and gave it up, unless
                 // we emit extra-debug-info, which requires local allocas :(.
index 39e0ca176eb0b5b02e5c6e0d30cbf246b7dcb6c9..227b2f6e1dc55ef0386c9458b9943a63fb78b06f 100644 (file)
@@ -568,7 +568,7 @@ pub fn get_res_dtor(ccx: @CrateContext,
 
 // Structural comparison: a rather involved form of glue.
 pub fn maybe_name_value(cx: &CrateContext, v: ValueRef, s: &str) {
-    if cx.sess.opts.save_temps {
+    if cx.sess.opts.cg.save_temps {
         s.with_c_str(|buf| {
             unsafe {
                 llvm::LLVMSetValueName(v, buf)
@@ -1389,7 +1389,7 @@ fn copy_args_to_allocas<'a>(fcx: &FunctionContext<'a>,
 
         bcx = _match::store_arg(bcx, args[i].pat, arg_datum, arg_scope_id);
 
-        if fcx.ccx.sess.opts.extra_debuginfo {
+        if fcx.ccx.sess.opts.debuginfo {
             debuginfo::create_argument_metadata(bcx, &args[i]);
         }
     }
@@ -2510,7 +2510,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
     let mut n_subcrates = 1;
     let cstore = sess.cstore;
     while cstore.have_crate_data(n_subcrates) { n_subcrates += 1; }
-    let is_top = !sess.building_library.get() || sess.gen_crate_map();
+    let is_top = !sess.building_library.get() || sess.opts.cg.gen_crate_map;
     let sym_name = if is_top {
         ~"_rust_crate_map_toplevel"
     } else {
index c9631a72ee7c9823589d6b91c237b3361e117153..81c671b495246ade18c43e7d75a6b7e1c2c3b373 100644 (file)
@@ -298,7 +298,7 @@ fn load_environment<'a>(bcx: &'a Block<'a>, cdata_ty: ty::t,
 
     // Store the pointer to closure data in an alloca for debug info because that's what the
     // llvm.dbg.declare intrinsic expects
-    let env_pointer_alloca = if bcx.ccx().sess.opts.extra_debuginfo {
+    let env_pointer_alloca = if bcx.ccx().sess.opts.debuginfo {
         let alloc = alloc_ty(bcx, ty::mk_mut_ptr(bcx.tcx(), cdata_ty), "__debuginfo_env_ptr");
         Store(bcx, llcdata, alloc);
         Some(alloc)
index 95875a01401826a267b0851f9ed7805fe30b8c36..2260ddea3c241928ceced4cc9e0bdd8979edbf24 100644 (file)
@@ -151,7 +151,7 @@ pub fn new(sess: session::Session,
             let tn = TypeNames::new();
 
             let mut intrinsics = base::declare_intrinsics(llmod);
-            if sess.opts.extra_debuginfo {
+            if sess.opts.debuginfo {
                 base::declare_dbg_intrinsics(llmod, &mut intrinsics);
             }
             let int_type = Type::int(targ_cfg.arch);
index d361c36fbdacd3a8142af145318fdae2b17fe6f2..c339e8bc648249f945e4bc1eaac638573659d143 100644 (file)
@@ -56,7 +56,7 @@ pub fn trans_stmt<'a>(cx: &'a Block<'a>,
             match d.node {
                 ast::DeclLocal(ref local) => {
                     bcx = init_local(bcx, *local);
-                    if cx.sess().opts.extra_debuginfo {
+                    if cx.sess().opts.debuginfo {
                         debuginfo::create_local_var_metadata(bcx, *local);
                     }
                 }
index d214a192ed8d48e670640a0eeb73d0c410be70c4..db8f83b41af8e19f0290811f6ab84aa8eedaae7e 100644 (file)
@@ -707,7 +707,7 @@ fn get_function_signature(cx: &CrateContext,
                               fn_decl: &ast::FnDecl,
                               param_substs: Option<@param_substs>,
                               error_span: Span) -> DIArray {
-        if !cx.sess.opts.extra_debuginfo {
+        if !cx.sess.opts.debuginfo {
             return create_DIArray(DIB(cx), []);
         }
 
@@ -784,8 +784,8 @@ fn get_template_parameters(cx: &CrateContext,
                 name_to_append_suffix_to.push_str(",");
             }
 
-            // Only create type information if extra_debuginfo is enabled
-            if cx.sess.opts.extra_debuginfo {
+            // Only create type information if debuginfo is enabled
+            if cx.sess.opts.debuginfo {
                 let actual_self_type_metadata = type_metadata(cx,
                                                               actual_self_type,
                                                               codemap::DUMMY_SP);
@@ -829,8 +829,8 @@ fn get_template_parameters(cx: &CrateContext,
                 name_to_append_suffix_to.push_str(",");
             }
 
-            // Again, only create type information if extra_debuginfo is enabled
-            if cx.sess.opts.extra_debuginfo {
+            // Again, only create type information if debuginfo is enabled
+            if cx.sess.opts.debuginfo {
                 let actual_type_metadata = type_metadata(cx, actual_type, codemap::DUMMY_SP);
                 let param_metadata_string = token::get_ident(ident.name);
                 let param_metadata = param_metadata_string.get()
index 58c89d6aa4a7c3663531d2107a27e044ef83b96a..17ef8732413e654f5d5c223abd1f95ee447c779e 100644 (file)
@@ -105,8 +105,11 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>) {
         maybe_sysroot: Some(@os::self_exe_path().unwrap().dir_path()),
         addl_lib_search_paths: @RefCell::new(libs),
         crate_types: ~[session::CrateTypeExecutable],
-        debugging_opts: session::PREFER_DYNAMIC,
         output_types: ~[link::OutputTypeExe],
+        cg: session::CodegenOptions {
+            prefer_dynamic: true,
+            .. session::basic_codegen_options()
+        },
         .. (*session::basic_options()).clone()
     };
 
index 91afa62b58c4a44d133dade503ed8808c7f576a2..1d8db84ab13934b5ef7874a4e6dee1365d73936c 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: --linker=llllll
+// compile-flags: -linker=llllll
 // error-pattern: the linker `llllll`
 
 fn main() {
index 47f86e52eaef97c5a597cd4710509c7e93e90575..aac5eebaf4af9ab9847c9eaebfd1d3e9f3461901 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z lto -Z prefer-dynamic
+// compile-flags: -Z lto -C prefer-dynamic
 
 // error-pattern: cannot prefer dynamic linking
 
index a67279254de3ab0357b2266eee48b15d7b21fa61..1c19baa4d8ed8604e1f6338eddec984d3c8b8aa9 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index b57c359046a68a11e791eb200f5486a004d63404..4a6bacad98f8f3cb23f5ee1fea2f0647ffdc951c 100644 (file)
@@ -16,7 +16,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 7f130f212e2a663721bf79d7fc562ebe3adc2135..bf9c70488b083eb07e1b6f3653d946178c2479c7 100644 (file)
@@ -13,7 +13,7 @@
 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
 // its numerical value.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 328e0176a91bf3694b4808abf89201b99aba88aa..29f0ea61ca77e0979dd3c23b3142eb7a9e4c1153 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index e6094fdef9fe07e134b34d698bd126d1531281ff..c8e29cfddb036b2b57238616da8d35c40f09f2ac 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index a05face4c5e323c16481fecc12268eacca040cc8..94a584efe94fa2414267f5b6b11d458f0bbc45c8 100644 (file)
@@ -15,7 +15,7 @@
 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
 // its numerical value.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 0bb8b247e597bdb904678661a1c6160e44597e2a..367d3b9a6daee34437d938d71e376bd6d354210c 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index ac77c05b832e14a484923e4b068cc9c2cba88f1a..2fcb67baecd8c27877ef50823bd3d286e7c3d9cf 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 04973c20799d0ca468565f1ec6a3918a2f6168b4..9863258930af1ec8198bc44cd412cfeee00a2d0f 100644 (file)
@@ -13,7 +13,7 @@
 // Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
 // its numerical value.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 304d150d57ef84ecff8bad3624d3d199ee43f028..b293b9d254523ad9829b7250b1958a196286b118 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index ff67d35a9cd2fb9ca383a8208874149e10295f23..21f3c0a99f72dfb7a1fbe8f2802b381349edb413 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 2c0edb783f830ff0f0a5884d571faefbb593ed3f..b4ca5dbeabe86312a136de23fbaadc3a870fb0fb 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index abb863f6b9e75fb5028f08ba524eb1112384b9d0..3b1e730ff9e2e977fba282698fc6ac1d36165a8a 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index d051ab9db93b19407338cb707964d27612dc3177..ee9ef7f2f0f2850fa223aebc67613b8bb912d6b1 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 90956a2641352b732e0cb8369e3be5e4948db704..92168292f93fcc249230590121914fb8f5f6fbe7 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index f9a1c30103c8e0dde3acb42c5e723392e47d1bcc..fc8f752936f4c481044209bc8e0342c7fff5339a 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 21c20325e3cdbf77f9d60e96ac4674d897b9cc00..b3d2357a63cf16d3e60445602cf90d46bb23b213 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index ed711e2ca0be62ee7e404017bedab8211e1fd3f1..5acc374896448507678597df996133a2381364dc 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 0d415a85172b6613fc161fbe0bfc930a885813d4..dd1cfb036f5712e51f06b1486a5d68355b929a84 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index a6f0a42bd3065a0996deb0e47c4e7c3ca6bd87ea..8ac16bdd2dd93274c3a23ff2d0ef60102202f1d5 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index aab302c72c5c0cd2b0afc2abc9ef8bfb96ab4480..057d2ac21b50651935562ff0e46b9e2192b2ced4 100644 (file)
@@ -17,7 +17,7 @@
 // before the arguments have been properly loaded when setting the breakpoint via the function name.
 // Therefore the setup here sets them using line numbers (so be careful when changing this file).
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:break function-arg-initialization.rs:139
 // debugger:break function-arg-initialization.rs:154
index 6bac417f54e56cd5bf1a07c7f913c4520bbcb60c..74c59550e0bb27396625f04d24faa544af0e3a82 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index da2d4e09fc67f1521cc64ebcc221afa058ff7470..690d6248ceaab011c0c6ce4226af7413aaf6511e 100644 (file)
@@ -16,7 +16,7 @@
 // consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
 // function name (and don't have to fall back on using line numbers).
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak immediate_args
 // debugger:rbreak binding
index d76551a212e4ea99329599f7c3c0e09f392aa80f..0741620fd20fc66af2406f7a4b771ba66bef85a8 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index a54238e981a5bc095430c4ee4d0c07264239f6dd..bb21cb381321935891367bb42d2ce32860bff2a1 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index f71106cacb161b2750771b8ee51572e64337ec6f..97607af4cb34b947f600d8e4a05ad987a0b4c1e5 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index a0551e570c7dd598e3a43fef97644098a053ace9..18f3f3109d5b085f130474f530836d51318393d9 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 5930af11567774fa14ff75d8cef06e0e25fb1891..b73566dad9e88bd401a118479080d86a9142a313 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print union on
 // debugger:rbreak zzz
 // debugger:run
index 143e2ded1938080846d25dc7ab406587650bced2..cc913ad8c9433f05bcc2ff99a64cb1ab51e6cc37 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 4355b4b98fe2288f40b406056de389971d6fa368..8a3fe3d1c2cebe2692a1ad31ea3a1b6521220b6f 100644 (file)
@@ -10,7 +10,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 0a737ffe0732ce92f669575f2b6552e5016e41da..497351ac51f167ed21d9cfd1858bba779e16afa7 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print union on
 // debugger:rbreak zzz
 // debugger:run
index 74064bb57822dba2d3b70bad337c04e7c3be2642..4d9fbe083eabc560d062ccb55b43bcf3d77455fb 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 00e240d147c4b3febda1684416160a5c8af5fdf5..30bbfd72c36cec76506f6ac86e738db584ee7a88 100644 (file)
@@ -19,7 +19,7 @@ fn main() {
 // This test case checks whether compile unit names are set correctly, so that the correct default
 // source file can be found.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:list
 // check:1[...]fn main() {
 // check:2[...]let args : ~[~str] = ::std::os::args();
index 04ccc59250d0be0b81630050f36bbfa2894810f2..a426a8e3f6ca83337896b72fc2a5907a41657ad7 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-win32
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 4cc58229ad0e2b44f687a5064a603321b3cd57f5..7020293a3ef327d570d2c2c909cd673fcffd329b 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-win32
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 7cb68e9890d29a242b9fdf2a28d3b1bcfb07444b..ffdd88cfa5950d882b9e14cdf9767554158832e0 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-win32
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index fbbb66f29048dc985080670e8559066f0ab54de8..d9f16e00f97a371f547c8425a03cb98dd8b59d82 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z debug-info
+// compile-flags:-g
 // debugger:run
 
 // Nothing to do here really, just make sure it compiles. See issue #8513.
index f052448c146a637a922a1e55d871e7c5d1ccd799..611b71b5c254d46cf3f0aacd563465ebff43cda2 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index fa750d247b1695a788443d276e723ec6f10ce79a..33138f4cc2b1734230b6cb222c30302d5cdfe7a8 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 2c732f9f8501f96606bba8c679b4f67f5aeb6d7c..7173529bc518f0b134e50b62b47e4d2e0ae144c9 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index f89f677291a0826ce5b3923d44a5a1fc8684bcea..43e8d61b0bbd8c42022dbbf4978099b6c5f10442 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index d97fdf66089248ed61fbb2f78bf291ea36411b1f..bd52e2ba65dbf4ebe2355324c87c18e8cfec9d8f 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 1eb03e95f8f84847bbb2ba99114e87bbdd4f2d77..4a10f09177ba1966d5fe529e0911167371057e08 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-win32
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index ef94fd3e331f4dd277e5cf1478ce71c61aa22144..b5e2ddb895986638a231e8331c4e1c50af6b85c9 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 8eed28170c57d2d08996ebdfaba46bba86ac85e8..2345857e3920964ec17e296d81fd77ec16cfafc7 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 4afc8b235edb6e9cd8d85e15273e9760d5d8d21e..5f35e712d7cd65d7f14bf19b34eb2615ba37d0f3 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 79594c5d3895d8d12f441ff84c08e24d9ba39e66..e0ff04ed0bcabf8809784b4e793de18276a81962 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index fc78aba707fe5eed966ca513a4339de1014f0ed9..a9179ed395fba5a365e71a051089bb0f57fd21f8 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 035ebf9caebd3fecc5e35acfd477c32b27040325..ca7f472f9777cd2789728258750b98de404db304 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 7cd5a845cba149849979a0510589c2a4ec7645b9..5b7c8b8562323cee29031fab3c6c74d9b651214b 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 029a5cd4c913a470e0e59c790aedb85056ab6396..ac2991171c65561b586977df9fb52b96b89b7d4c 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 29a7de4a3169cc56ff55c185b98be66a8c0f25f9..e6b16adc3862bea840fb99109006c65cd2daae16 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index f5abe6e249d712cf41ce79006502224d37897acb..dc22296baad60cf399c56027fbd21cf75f1334e1 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index e8c7812eb0957ccbcbb96219b1cb0923786ca4b4..db154ff599c87cf10607740f9345925a19795f4b 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index fc114a79ad65b3cb2619e394ab7090bed3ff374a..3fa596285c6b9a9d3b71a48dd4f414b83ee32199 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index c263d1155093e02eee63205997f31568899d876e..a634eba2850927e734180ae924481b8dd2c550f9 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 5e6480fa8c5601579c21cfacaea3b561e58a8572..59b65e1119c92b16135c31ba1a2ffadde146a09b 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 795b9d275dd78c219a29446ce6f7d2b266ddf2e6..0d3883f1102e23a76528d46eec2182c0b1ba4597 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 4bdc9994c439f9ec484036a8f90254d0afd74ba0..0e3205838de5d78cf78f644702cf656373637ca2 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:run
 
 // Test whether compiling a recursive enum definition crashes debug info generation. The test case
index cf693d7e35623342f9efc4bcf0b43fa2de3ba905..4119549010c55498a272e70c04a02706aee26b66 100644 (file)
@@ -12,7 +12,7 @@
 
 #[feature(managed_boxes)];
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 9f0b0ea84142d1e8b6244c31f37d7db7d6c974d2..e2e9766a4b52de86a316560936b8401f0c7f97a7 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 5ae88b3d0ce385934f4b3245a8c28bbe30439c19..bc2570f1a371a6a6585b973f1fac1d565f66ae76 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 7bd77d22a2f7c40ddf0357dbb6c4010aad28621c..85e917c091c49ece85c66af3474cb647625dc191 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 9055487aaa7124905fc14606051b0ae0166e8cda..b21e59283ad4db919f7878eba936d2d3ae414493 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 6d79d4d813ffa1d74cde967e8e15e287d20db566..9b4fa3c5c2a97d76e14ae9e995747800b60363d7 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index 8d50149a2844d34d5b8f782b207ddbf16eb4f3ca..3bc6ce70a71785dd3d6fd559f5bfee6b75738068 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 71685c8068200f0ec873db5c7cf4a2cb6500f5f8..e99a4234df0e1ae2e955d487225431ce6bf592fc 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index b56f6267a8d5c6eb20359d6233a78712889e51c8..fd94faeb7c217dee7952388dfac31d64523b5c0f 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index b706ad1c38cc4ae8b4b204d4e19436da84c4fbe1..01a8233a96e87ecfdfa177de26571b3659f295b9 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print union on
 // debugger:rbreak zzz
 // debugger:run
index d46d0b1cd887ecbb40fd9a93553cc954f230949e..7040448cb35ca817d61123abdaa8a5b1a8fbed16 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index d7804da78941a5e043eb1c9ef8e5611526f03d05..a5c1d0e81c6d29876c1ca965b96401d4ca4594db 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print union on
 // debugger:rbreak zzz
 // debugger:run
index febd60614687d1a6a5f27bb5389588e13a63a47b..bae094cefd781b9841d55eabf7746369a053df64 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 05258d53586849ad59c5f041cc13bca7fb3cc2d7..429f2e77deb5d398b52a10d3a257ba04854575d5 100644 (file)
@@ -10,7 +10,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 
index de46e1aea5822be7219341a63c274ea44084fb17..ef34c50bbf7b2b86576d254d703db4317a23b57b 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:run
 
 #[allow(unused_variable)];
index b60f21fe6ce8cf2b92b10da1d0edf49464d7542a..81b0348bed0f4bb74204b23957bb5187218ea9e7 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 76475109382c664d61de53f14b16fc59e1506f0a..19c331079b909ceb04a203a2470da5e9eb4964f3 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 2d571ef41607a6ef374058f5feb8cd89fcba9ba6..1993fe91b733c0a95dbee52b5473b5f65c0c5555 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index c9d577a24917ecede5b5a2aa137c4ad78b10cc0d..fb90fe5c138de0776301cb07ead9b4fa893423ab 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-tidy-linelength
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print union on
 // debugger:rbreak zzz
 // debugger:run
index 647a6e55f98574c2b192035c03b3f7b346bdbc88..f0383b97dd0f7178741093ba70f3c2c3b73718e7 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 1032356689f305eba5c643c05c753aeb13a383b6..dc586afaa2425571a645dcb1131fb118c27b54aa 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-win32: FIXME #10474
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 82ef467925a3a5fe1a6bb61cbb1b17c8aaad87f2..e9b8dc46625156b5629d7ce2623a71eda70d011a 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 53287a8511bce43ce7217004584ca981da02a2d1..092f7ee443e153a0e25ec4319ad3cef1856f66bd 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:rbreak zzz
 // debugger:run
 // debugger:finish
index 635608604b133e966a73f0db4cd1a3ab456065f2..00e0e0fa783105c53372f80e4fd4ed2da3f044a0 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index b1224d14dc474ec381683214e006ae7a7d06afde..6806e2f2b3d5bcd80dc9b4b5a2d7fa0b38d4770c 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-android: FIXME(#10381)
 
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
 // debugger:set print pretty off
 // debugger:rbreak zzz
 // debugger:run
index 7f466573da73087c0b72de342dd54fdadde6cdb4..9a198977aa384e45a6ddf509af6f658f2d8a682e 100644 (file)
@@ -1,7 +1,7 @@
 -include ../tools.mk
 
 all:
-       $(RUSTC) lib.rs -Z gen-crate-map
+       $(RUSTC) lib.rs -C gen-crate-map
        ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
        $(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
        $(call RUN,main)
index 7f466573da73087c0b72de342dd54fdadde6cdb4..9a198977aa384e45a6ddf509af6f658f2d8a682e 100644 (file)
@@ -1,7 +1,7 @@
 -include ../tools.mk
 
 all:
-       $(RUSTC) lib.rs -Z gen-crate-map
+       $(RUSTC) lib.rs -C gen-crate-map
        ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
        $(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
        $(call RUN,main)
index a81f19d6eb36bdf550b208c463b790cb2a0dcfc7..6fa5369015bbbbffa1fb7c50b54061868ae37ba6 100644 (file)
@@ -5,9 +5,9 @@ ifneq ($(shell uname),Darwin)
 endif
 
 all:
-       $(RUSTC) foo.rs -Z gen-crate-map
+       $(RUSTC) foo.rs -C gen-crate-map
        ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
-       $(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++ 
+       $(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
        $(call RUN,bar)
        rm $(call STATICLIB,foo*)
        $(call RUN,bar)
index a491fda7dc232bc17517f1a490a9fd0cc52b50d7..af120c9baebba9d1ae5d2b43d9720d1ac3b1b9cc 100644 (file)
@@ -5,7 +5,7 @@ ifneq ($(shell uname),Darwin)
 endif
 
 all:
-       $(RUSTC) foo.rs -Z gen-crate-map -Z lto
+       $(RUSTC) foo.rs -C gen-crate-map -Z lto
        ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
        $(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
        $(call RUN,bar)
index 9ab2abca72952b0480d8ed73254e13e2be9f4b30..76106ada144874ff1423d9a83db0d258fb71b057 100644 (file)
@@ -2,6 +2,6 @@
 
 all:
        $(RUSTC) both.rs
-       $(RUSTC) dylib.rs -Z prefer-dynamic
+       $(RUSTC) dylib.rs -C prefer-dynamic
        $(RUSTC) prog.rs
        $(call RUN,prog)
index 6fb7434e68ab3a43c10b0163223da9886fbab8e2..38759b2f52490a52c97724df3f5eaafde5207a64 100644 (file)
@@ -2,7 +2,7 @@
 
 all:
        $(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib
-       $(RUSTC) foo.rs -Z prefer-dynamic
+       $(RUSTC) foo.rs -C prefer-dynamic
        $(call RUN,foo)
        rm $(TMPDIR)/*bar*
        $(call FAILS,foo)
index 53699e0dd984a7b7d5b58823f8dd15cb1b6e649e..ea7fa06f5ef19268c73b802862e413a8ec6b0563 100644 (file)
@@ -1,6 +1,6 @@
 -include ../tools.mk
 # Notice the space in the end, this emulates the output of pkg-config
-RUSTC_FLAGS = --link-args "-lc "
+RUSTC_FLAGS = -C link-args="-lc "
 
 all:
        $(RUSTC) $(RUSTC_FLAGS) empty.rs
index fa7d68cf921fd3135eb63bdfda8e772c18c6d6de..f91112416e372868d9997bf79af96db300b78011 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-Z debug-info
+// compile-flags:-g
 
 pub trait TraitWithDefaultMethod {
     fn method(self) {