debuginfo: Generate cross-crate unique type identifiers for debuginfo types.
With this change, rustc creates a unique type identifier for types in debuginfo. These type identifiers are used by LLVM to correctly handle link-time-optimization scenarios but also help rustc with dealing with inlining from other crates. For more information, see the documentation block at the top of librustc/middle/trans/debuginfo.rs. Fixes #13681.
This commit is contained in:
parent
c0a6f72e8b
commit
0a98a4e422
File diff suppressed because it is too large
Load Diff
26
src/test/auxiliary/cross_crate_debuginfo_type_uniquing.rs
Normal file
26
src/test/auxiliary/cross_crate_debuginfo_type_uniquing.rs
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// no-prefer-dynamic
|
||||
#![crate_type = "rlib"]
|
||||
// compile-flags:-g
|
||||
|
||||
struct S1;
|
||||
|
||||
impl S1 {
|
||||
fn f(&mut self) { }
|
||||
}
|
||||
|
||||
|
||||
struct S2;
|
||||
|
||||
impl S2 {
|
||||
fn f(&mut self) { }
|
||||
}
|
24
src/test/debuginfo/cross-crate-type-uniquing.rs
Normal file
24
src/test/debuginfo/cross-crate-type-uniquing.rs
Normal file
@ -0,0 +1,24 @@
|
||||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-android: FIXME(#10381)
|
||||
|
||||
// aux-build:cross_crate_debuginfo_type_uniquing.rs
|
||||
extern crate cross_crate_debuginfo_type_uniquing;
|
||||
|
||||
// no-prefer-dynamic
|
||||
// compile-flags:-g -Zlto
|
||||
|
||||
pub struct C;
|
||||
pub fn p() -> C {
|
||||
C
|
||||
}
|
||||
|
||||
fn main() { }
|
Loading…
x
Reference in New Issue
Block a user