about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
AgeCommit message (Collapse)AuthorLines
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
2019-02-18librustc_codegen_llvm => 2018Taiki Endo-33/+33
2019-02-10rustc: doc commentsAlexander Regueiro-5/+5
2019-01-25Set the DICompileUnit emissionKindJosh Stone-2/+4
2019-01-25Rebase to the llvm-project monorepoJosh Stone-5/+10
The new git submodule src/llvm-project is a monorepo replacing src/llvm and src/tools/{clang,lld,lldb}. This also serves as a rebase for these projects to the new 8.x branch from trunk. The src/llvm-emscripten fork is unchanged for now.
2019-01-22Simplify the version checkTom Tromey-4/+3
Address the review comments by simplifying the version check to just "< 8".
2019-01-22Fix issue 57762Tom Tromey-1/+5
Issue 57762 points out a compiler crash when the compiler was built using a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes #57762
2019-01-15Querify entry_fnIgor Matuszewski-4/+3
2019-01-12Use `ptr::eq` where applicableIgor Matuszewski-1/+1
2019-01-04add support for principal-less trait object typesAriel Ben-Yehuda-7/+12
should be a pure refactoring.
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-6/+6
2018-12-25Remove licensesMark Rousskov-90/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-6/+6
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-2/+2
2018-12-03Auto merge of #55010 - tromey:Bug-9224-generic-parameters, r=michaelwoeristerbors-5/+61
Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes #9224
2018-12-02Auto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddybbors-5/+5
Refactor rustc_codegen_ssa cc #56108 (not all things are done yet) This removes an unsafe method from cg_ssa. r? @eddyb cc @sunfishcode
2018-11-29Add template parameter debuginfo to generic typesTom Tromey-5/+61
This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes #9224
2018-11-29Use implicit deref instead of BuilderMethods::cx()bjorn3-5/+5
2018-11-29Rename conversion util; remove duplicate util in librustc_codegen_llvm.Corey Farwell-2/+2
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+1
2018-11-23Auto merge of #54071 - eddyb:alignsssss, r=oli-obkbors-32/+28
rustc_target: separate out an individual alignment quantity type from Align. Before this PR, `rustc_target::abi::Align` combined "power-of-two alignment quantity" semantics, with a distinction between ABI (required) and preferred alignment (by having two quantities). After this PR, `Align` is only *one* such quantity, and a new `AbiAndPrefAlign` type is introduced to hold the pair of ABI and preferred `Align` quantities. `Align` is used everywhere one quantity is necessary/sufficient, simplifying some of the code in codegen/miri, while `AbiAndPrefAlign` only in layout computation (to propagate preferred alignment). r? @oli-obk cc @nagisa @RalfJung @nikomatsakis
2018-11-22rustc_target: avoid using AbiAndPrefAlign where possible.Eduard-Mihai Burtescu-19/+19
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-15/+15
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-16/+12
2018-11-21rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.Eduard-Mihai Burtescu-1/+1
2018-11-16[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.Eduard-Mihai Burtescu-6/+6
2018-11-16All Builder methods now take &mut self instead of &selfDenis Merigoux-4/+4
2018-11-16Finished moving backend-agnostic code to rustc_codegen_ssaDenis Merigoux-15/+15
2018-11-16Great separation of librustc_codegen_llvm: librustc_codegen_ssa compilesDenis Merigoux-82/+16
2018-11-16Preparing the generalization of base:compile_coodegen_unitDenis Merigoux-0/+4
2018-11-16Move doc to trait declarationsDenis Merigoux-6/+0