about summary refs log tree commit diff
path: root/src/test/debug-info
AgeCommit message (Collapse)AuthorLines
2014-05-07debuginfo: Split debuginfo autotests into debuginfo-gdb and debuginfo-lldbMichael Woerister-8566/+0
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-63/+68
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-29rustc: Enable -f{function,data}-sectionsAlex Crichton-0/+10
The compiler has previously been producing binaries on the order of 1.8MB for hello world programs "fn main() {}". This is largely a result of the compilation model used by compiling entire libraries into a single object file and because static linking is favored by default. When linking, linkers will pull in the entire contents of an object file if any symbol from the object file is used. This means that if any symbol from a rust library is used, the entire library is pulled in unconditionally, regardless of whether the library is used or not. Traditional C/C++ projects do not normally encounter these large executable problems because their archives (rust's rlibs) are composed of many objects. Because of this, linkers can eliminate entire objects from being in the final executable. With rustc, however, the linker does not have the opportunity to leave out entire object files. In order to get similar benefits from dead code stripping at link time, this commit enables the -ffunction-sections and -fdata-sections flags in LLVM, as well as passing --gc-sections to the linker *by default*. This means that each function and each global will be placed into its own section, allowing the linker to GC all unused functions and data symbols. By enabling these flags, rust is able to generate much smaller binaries default. On linux, a hello world binary went from 1.8MB to 597K (a 67% reduction in size). The output size of dynamic libraries remained constant, but the output size of rlibs increased, as seen below: libarena - 2.27% bigger ( 292872 => 299508) libcollections - 0.64% bigger ( 6765884 => 6809076) libflate - 0.83% bigger ( 186516 => 188060) libfourcc - 14.71% bigger ( 307290 => 352498) libgetopts - 4.42% bigger ( 761468 => 795102) libglob - 2.73% bigger ( 899932 => 924542) libgreen - 9.63% bigger ( 1281718 => 1405124) libhexfloat - 13.88% bigger ( 333738 => 380060) liblibc - 10.79% bigger ( 551280 => 610736) liblog - 10.93% bigger ( 218208 => 242060) libnative - 8.26% bigger ( 1362096 => 1474658) libnum - 2.34% bigger ( 2583400 => 2643916) librand - 1.72% bigger ( 1608684 => 1636394) libregex - 6.50% bigger ( 1747768 => 1861398) librustc - 4.21% bigger (151820192 => 158218924) librustdoc - 8.96% bigger ( 13142604 => 14320544) librustuv - 4.13% bigger ( 4366896 => 4547304) libsemver - 2.66% bigger ( 396166 => 406686) libserialize - 1.91% bigger ( 6878396 => 7009822) libstd - 3.59% bigger ( 39485286 => 40902218) libsync - 3.95% bigger ( 1386390 => 1441204) libsyntax - 4.96% bigger ( 35757202 => 37530798) libterm - 13.99% bigger ( 924580 => 1053902) libtest - 6.04% bigger ( 2455720 => 2604092) libtime - 2.84% bigger ( 1075708 => 1106242) liburl - 6.53% bigger ( 590458 => 629004) libuuid - 4.63% bigger ( 326350 => 341466) libworkcache - 8.45% bigger ( 1230702 => 1334750) This increase in size is a result of encoding many more section names into each object file (rlib). These increases are moderate enough that this change seems worthwhile to me, due to the drastic improvements seen in the final artifacts. The overall increase of the stage2 target folder (not the size of an install) went from 337MB to 348MB (3% increase). Additionally, linking is generally slower when executed with all these new sections plus the --gc-sections flag. The stage0 compiler takes 1.4s to link the `rustc` binary, where the stage1 compiler takes 1.9s to link the binary. Three megabytes are shaved off the binary. I found this increase in link time to be acceptable relative to the benefits of code size gained. This commit only enables --gc-sections for *executables*, not dynamic libraries. LLVM does all the heavy lifting when producing an object file for a dynamic library, so there is little else for the linker to do (remember that we only have one object file). I conducted similar experiments by putting a *module's* functions and data symbols into its own section (granularity moved to a module level instead of a function/static level). The size benefits of a hello world were seen to be on the order of 400K rather than 1.2MB. It seemed that enough benefit was gained using ffunction-sections that this route was less desirable, despite the lesser increases in binary rlib size.
2014-04-20Allow inheritance between structs.Nick Cameron-3/+15
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-16debuginfo: Add a test case for issue #12886.Michael Woerister-0/+35
2014-04-14Use new attribute syntax in python files in src/etc too (#13478)Manish Goregaokar-73/+73
2014-04-10debuginfo: Don't create debuginfo for statics inlined from other crates.Michael Woerister-0/+26
Fixes issue #13213, that is linker errors when the inlined static has been optimized out of the exporting crate.
2014-04-08Register new snapshotsAlex Crichton-1/+1
2014-04-04Fix inner attribute syntax from `#[foo];` to `#![foo]`Timothée Ravier-1/+1
From the 0.10 changelog: * The inner attribute syntax has changed from `#[foo];` to `#![foo]`.
2014-04-04auto merge of #13291 : thestinger/rust/no_null, r=alexcrichtonbors-6/+6
This was missed when dropping the null-termination from our string types. An explicit null byte can still be placed anywhere in a string if desired, but there's no reason to stick one at the end of every string constant.
2014-04-03stop asking LLVM to null-terminate stringsDaniel Micay-6/+6
This was missed when dropping the null-termination from our string types. An explicit null byte can still be placed anywhere in a string if desired, but there's no reason to stick one at the end of every string constant.
2014-04-03test/debug-info: Add/remove ignore-win32 flagsklutzy-7/+14
Fixes #10474
2014-04-02Fix fallout of requiring uint indicesAlex Crichton-3/+3
2014-03-27Initial support for emitting DWARF for static vars.gentlefolk-70/+601
Only supports crate level statics. No debug info is generated for function level statics. Closes #9227.
2014-03-22Remove outdated and unnecessary std::vec_ng::Vec imports.Huon Wilson-39/+5
(And fix some tests.)
2014-03-21test: Automatically remove all `~[T]` from tests.Patrick Walton-3/+3
2014-03-14debuginfo: Make limited-debuginfo test case more robust against GDB output ↵Michael Woerister-4/+4
variations. Fixes issue #12787.
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-1/+1
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-12auto merge of #12816 : michaelwoerister/rust/limited-debuginfo, r=alexcrichtonbors-3/+3
Fixes #12811 as described in the issue.
2014-03-11test: Relax a debuginfo testAlex Crichton-5/+5
This test is blocking a snapshot. Apparently the snapshot bot doesn't print 'limited-debuginfo::main()' but rather just 'main()'. Who knew?
2014-03-11debuginfo: Improve commandline option handling for debuginfo (fixes #12811)Michael Woerister-3/+3
The `-g` flag does not take an argument anymore while the argument to `--debuginfo` becomes mandatory. This change makes it possible again to run the compiler like this: `rustc -g ./file.rs` This did not work before because `./file.rs` was misinterpreted as the argument to `-g`. In order to get limited debuginfo, one now has to use `--debuginfo=1`.
2014-03-06debuginfo: Add test case for limited debuginfoMichael Woerister-0/+52
2014-03-06debuginfo: Expose limited debuginfo in command line optionsMichael Woerister-2/+2
2014-02-19debuginfo: Re-enable test case that should have worked all along.Michael Woerister-1/+0
2014-02-19debuginfo: Move test case from run-pass to debug-info directory so it does ↵Michael Woerister-0/+25
not interfere with RUSTFLAGS=-g
2014-02-19debuginfo: Add support for simd typesMichael Woerister-0/+70
2014-02-11Change `xfail` directives in compiletests to `ignore`, closes #11363Florian Hahn-181/+181
2014-02-10Consolidate codegen-related compiler flagsAlex Crichton-84/+84
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
2014-02-07add a hack to fix debug-info tests under gdb 7.7Daniel Micay-1/+1
2014-02-07Added tests to make tidyDerek Guenther-43/+61
2014-02-07Removed @self and @Trait.Eduard Burtescu-339/+0
2014-02-03xfail a test to unblock the snapshotAlex Crichton-0/+1
cc #12021
2014-02-02Update/delete tests using @[].Huon Wilson-8/+2
2014-01-29auto merge of #11879 : thestinger/rust/frame-pointer, r=alexcrichtonbors-3/+0
This is still used for Rust code (`Options.NoFramePointerElim = true`).
2014-01-29enable fp-elim when debug info is disabledDaniel Micay-3/+0
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
2014-01-27debuginfo: Fix name attribute for DWARF compile unitsMichael Woerister-0/+27
2014-01-17Link lifetimes in `let` patterns just as we do for `match` patternsNiko Matsakis-3/+3
2014-01-14remove reference counting headers from ~Daniel Micay-18/+12
Unique pointers and vectors currently contain a reference counting header when containing a managed pointer. This `{ ref_count, type_desc, prev, next }` header is not necessary and not a sensible foundation for tracing. It adds needless complexity to library code and is responsible for breakage in places where the branch has been left out. The `borrow_offset` field can now be removed from `TyDesc` along with the associated handling in the compiler. Closes #9510 Closes #11533
2014-01-13librustc: Remove `@` pointer patterns from the languagePatrick Walton-7/+4
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-2/+2
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-08auto merge of #11401 : michaelwoerister/rust/issue11322, r=alexcrichtonbors-0/+40
`expand_include_str()` in libsyntax seems to have corrupted the CodeMap by always setting the BytePos of any included files to zero. It now uses `CodeMap::new_filemap()` which should set everything properly. This should fix issue #11322 but I don't want to close it before I have confirmation from the reporters that the problem is indeed fixed.
2014-01-08Fix CodeMap issue in expand_include_str()Michael Woerister-0/+40
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-2/+2
2014-01-02debuginfo: Add test case for recursive enum types (issue #11083)Michael Woerister-0/+33
2013-12-17debuginfo: Updated test cases to also test by-value self arguments.Michael Woerister-193/+192
2013-12-16debuginfo: Add test cases for function prologue handling.Michael Woerister-0/+493
2013-12-16debuginfo: Set the is_local_to_unit attribute of functions correctlyMichael Woerister-2/+1
2013-12-14auto merge of #10932 : alexcrichton/rust/feature-update, r=cmrbors-1/+22
2013-12-14Handle more cases in the heap lintsAlex Crichton-1/+22