summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
AgeCommit message (Collapse)AuthorLines
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc_codegen_llvm: `deny(internal)`.Eduard-Mihai Burtescu-5/+1
2019-06-12rustc_codegen_llvm: `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+1
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-4/+5
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-06-02remove unneeded depsMark Mansi-2/+1
2019-06-02remove reexport of rustc::ty::InstanceMark Mansi-3/+2
2019-06-02Use `assert_usize` instead of `unwrap_usize` in several placesvarkor-3/+1
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-5/+5
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-22Rollup merge of #60973 - nnethercote:fix-file_metadata-more, r=michaelwoeristerMazdak Farrokhzad-34/+34
Avoid symbol interning in `file_metadata`. This commit changes `created_files` so it uses strings directly as keys, rather than symbols derived from the strings. This avoids the cost of having to do the hash table lookups to produce the symbols from the strings. The commit also uses `entry` to avoid doing a repeated hash table lookup (`get` + `insert`). Note that PR #60467 improved this code somewhat; this is a further improvement. r? @davidtwco
2019-05-21debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1.Michael Woerister-2/+21
https://github.com/rust-lang/rust/commit/cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke a number of tools. This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format. See https://github.com/rust-lang/rust/issues/60020 for more info.
2019-05-20Avoid symbol interning in `file_metadata`.Nicholas Nethercote-34/+34
This commit changes `created_files` so it uses strings directly as keys, rather than symbols derived from the strings. This avoids the cost of having to do the hash table lookups to produce the symbols from the strings. The commit also uses `entry` to avoid doing a repeated hash table lookup (`get` + `insert`). Note that PR #60467 improved this code somewhat; this is a further improvement.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-2/+2
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-91/+192
Multi-variant layouts for generators This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants. Required for optimizing generator layouts (#52924). There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible. This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator. Also, fixes #59972. Future work: - Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924) - In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172) - Preserve debuginfo scopes across generator yield points
2019-05-03Address review commentsTyler Mandry-5/+5
2019-05-03Split out debuginfo from type info in MIR GeneratorLayoutTyler Mandry-2/+3
2019-05-03Make variant_fields inner an IndexVecTyler Mandry-1/+1
2019-05-02Avoid repeated interning of static strings.Nicholas Nethercote-10/+14
`file_metadata_raw` interns the strings `"<unknown>"` and `""` very frequently. This commit avoids that, which reduces the number of symbols interned significantly and reduces instruction counts by up to 0.5% on some workloads.
2019-04-26Update handling of Tuplevarkor-2/+3
2019-04-25Generalize discriminant info calls for generators and ADTsTyler Mandry-8/+4
2019-04-25Include generator locals as field names in debuginfoTyler Mandry-8/+17
2019-04-25Make generator object debuginfo easier to readTyler Mandry-8/+17
2019-04-25Describe generator variants in debuginfoTyler Mandry-94/+176
2019-04-25Support variantful generatorsTyler Mandry-1/+5
This allows generators to overlap fields using variants.
2019-04-23rustc_codegen_ssa: rename debuginfo_upvar_decls_ops_sequence to ↵Eduard-Mihai Burtescu-1/+1
debuginfo_upvar_ops_sequence.
2019-04-20Move cg_llvm/debuginfo/type_names.rs to cg_ssabjorn3-267/+10
2019-04-11Add discr_index to multi-variant layoutsTyler Mandry-12/+24
We relax the assumption that the discriminant is always field 0, in preparations for layouts like generators where this is not going to be the case.
2019-04-11describe_enum_variant: Reduce code duplicationTyler Mandry-12/+10
2019-04-05rustc: Start implementing compat with LLVM 9Alex Crichton-6/+5
This commit doesn't actually migrate to LLVM 9, but it brings our own C++ bindings in line with LLVM 9 and able to compile against tip of tree. The changes made were: * The `MainSubprogram` flag for debuginfo moved between flag types. * Iteration of archive members was tweaked slightly and we have to construct the two iterators before constructing the returned `RustArchiveIterator` value. * The `getOrInsertFunction` binding now returns a wrapper which we use `getCallee()` on to get the value we're interested in.
2019-04-01Fix typoAaron Hill-1/+1
2019-03-31Only track 'visited' state for function typesAaron Hill-18/+31
2019-03-31Fix typosAaron Hill-4/+2
2019-03-31Fix inverted panic checkAaron Hill-1/+1
2019-03-31Fix stack overflow when generating debuginfo for 'recursive' typeAaron Hill-17/+100
By using 'impl trait', it's possible to create a self-referential type as follows: fn foo() -> impl Copy { foo } This is a function which returns itself. Normally, the signature of this function would be impossible to write - it would look like 'fn foo() -> fn() -> fn() ...' e.g. a function which returns a function, which returns a function... Using 'impl trait' allows us to avoid writing this infinitely long type. While it's useless for practical purposes, it does compile and run However, issues arise when we try to generate llvm debuginfo for such a type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we generate debuginfo, which can lead to us recursing back to the original 'fn' type when we try to process its return type. To resolve this, I've modified debuginfo generation to account for these kinds of weird types. Unfortunately, there's no 'correct' debuginfo that we can generate - 'impl trait' does not exist in debuginfo, and this kind of recursive type is impossible to directly represent. To ensure that we emit *something*, this commit emits dummy debuginfo/type names whenever it encounters a self-reference. In practice, this should never happen - it's just to ensure that we can emit some kind of debuginfo, even if it's not particularly meaningful Fixes #58463
2019-03-31Rollup merge of #59519 - eddyb:layout-variants-refactor, r=oli-obkMazdak Farrokhzad-20/+48
rustc_target: factor out common fields of non-Single Variants. @tmandry and I were discussing ways to generalize the current variants/discriminant layout to allow more fields in the "`enum`" (or another multi-variant types, such as potentially generator state, in the future), shared by all variants, than just the tag/niche discriminant. This refactor should make it easier to extend multi-variant layouts, as nothing is duplicating anymore between "tagged enums" and "niche-filling enums". r? @oli-obk
2019-03-30Rollup merge of #59380 - philipc:thinlto-variant, r=michaelwoeristerMazdak Farrokhzad-1/+17
Fix invalid DWARF for enums when using ThinLTO We were setting the same identifier for both the DW_TAG_structure_type and the DW_TAG_variant_part. This becomes a problem when using ThinLTO becauses it uses the identifier as a key for a map of types that is used to delete duplicates based on the ODR, so one of them is deleted as a duplicate, resulting in invalid DWARF. The DW_TAG_variant_part isn't a standalone type, so it doesn't need an identifier. Fix by omitting its identifier. ODR uniquing is [enabled here](https://github.com/rust-lang/rust/blob/f21dee2c6179276321a88a63300dce74ff707e92/src/rustllvm/PassWrapper.cpp#L1101).
2019-03-29Move get_param and set_value_namebjorn3-0/+7
2019-03-29[WIP] Make some debug info methods take &mut FunctionDebugContextbjorn3-2/+2
declare_local still takes &FunctionDebugContext, because of borrowck errors
2019-03-29Remove internal mutability from source_locations_enabledbjorn3-4/+4
2019-03-29rustc_target: factor out common fields of non-Single Variants.Eduard-Mihai Burtescu-20/+48
2019-03-28Rollup merge of #58717 - hellow554:nonzero_parse, r=oli-obkMazdak Farrokhzad-1/+2
Add FromStr impl for NonZero types This is a WIP implementation because I do have some questions regarding the solution. Somebody should ping the lang team on this I guess. Please see the annotations on the code for more details. Closes #58604
2019-03-28fixed shift overflowMarcel Hellwig-1/+2
Fix according to oli-obk (https://github.com/rust-lang/rust/pull/58717#issuecomment-477494457)
2019-03-27Give variant parts their own unique idPhilip Craig-13/+23
and bump llvm version in test
2019-03-23Fix invalid DWARF for enums when using thinltoPhilip Craig-7/+13
We were setting the same identifier for both the DW_TAG_structure_type and the DW_TAG_variant_part. This becomes a problem when using thinlto becauses it uses the identifier as a key for a map of types that is used to delete duplicates based on the ODR, so one of them is deleted as a duplicate, resulting in invalid DWARF. The DW_TAG_variant_part isn't a standalone type, so it doesn't need an identifier. Fix by omitting its identifier.
2019-03-22Correct minimum system LLVM version in testsSamuel Holland-3/+5
Since commit 9452a8dfa3ba, the new debug info format is only generated for LLVM 8 and newer versions. However, the tests still assume that LLVM 7 will use the new debug info format. Fix the tests (and a comment in the code) to match the actual version check.
2019-03-11Fix incorrect links in librustc_codegen_llvm documentationNikita Baksalyar-3/+3
2019-02-27Rename variadic to c_variadicDan Robertson-1/+1
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27rename Substs to InternalSubstscsmoe-5/+5
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-25librustc_codegen_llvm: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-16/+16