-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dead code from rustc_codegen_llvm and the LLVM wrapper #136653
Conversation
pub kind: OptimizationDiagnosticKind, | ||
pub pass_name: String, | ||
pub function: &'ll Value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field should be kept, even if it's currently unused on the Rust side, because it reflects part of a larger LLVM data structure.
(Keeping C++ and Rust in sync is easier if we don't have ad-hoc gaps in individual structures and enums.)
InlineAsm(InlineAsmDiagnostic), | ||
PGO(&'ll DiagnosticInfo), | ||
Linker(&'ll DiagnosticInfo), | ||
Unsupported(&'ll DiagnosticInfo), | ||
|
||
/// LLVM has other types that we do not wrap here. | ||
UnknownDiagnostic(&'ll DiagnosticInfo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this field shouldn't be removed, even if it's unused.
pub enum LLVMMachineType { | ||
AMD64 = 0x8664, | ||
I386 = 0x14c, | ||
ARM64 = 0xaa64, | ||
ARM64EC = 0xa641, | ||
ARM = 0x01c0, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historical note: It looks like we used to pass this to LLVM code for emitting import libraries on Windows, and it probably became unnecessary after #129164. Good to remove.
pub enum TailCallKind { | ||
None, | ||
Tail, | ||
MustTail, | ||
NoTail, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark: This removal was justified in #135502 (comment), so good to remove.
@@ -799,7 +775,6 @@ unsafe extern "C" { | |||
} | |||
|
|||
pub type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void); | |||
pub type InlineAsmDiagHandlerTy = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historical note: Looks like this became unused in #100460.
@@ -2586,8 +2559,6 @@ unsafe extern "C" { | |||
|
|||
pub fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32; | |||
|
|||
pub fn LLVMRustIsBitcode(ptr: *const u8, len: usize) -> bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historical note: This became unused in 9de0d14.
@@ -853,7 +828,6 @@ pub mod debuginfo { | |||
pub type DIFile = DIScope; | |||
pub type DILexicalBlock = DIScope; | |||
pub type DISubprogram = DIScope; | |||
pub type DINameSpace = DIScope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historical note: This became unused in #136375.
The changes to |
73d5478
to
2a6b274
Compare
Done |
Thanks! @bors r+ rollup |
Remove dead code from rustc_codegen_llvm and the LLVM wrapper First step to clean up the LLVM wrapper: remove existing dead code. Split out of rust-lang#135502 r? `@Zalathar`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#134367 (Stabilize `feature(trait_upcasting)`) - rust-lang#135354 ([Debuginfo] Add MSVC Synthetic and Summary providers to LLDB) - rust-lang#135940 (Update toolstate maintainers) - rust-lang#135945 (Remove some unnecessary parens in `assert!` conditions) - rust-lang#136577 (Pattern Migration 2024: try to suggest eliding redundant binding modifiers) - rust-lang#136598 (Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions) - rust-lang#136653 (Remove dead code from rustc_codegen_llvm and the LLVM wrapper) - rust-lang#136664 (replace one `.map_or(true, ...)` with `.is_none_or(...)`) Failed merges: - rust-lang#136193 (Implement pattern type ffi checks) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#134367 (Stabilize `feature(trait_upcasting)`) - rust-lang#135940 (Update toolstate maintainers) - rust-lang#135945 (Remove some unnecessary parens in `assert!` conditions) - rust-lang#136577 (Pattern Migration 2024: try to suggest eliding redundant binding modifiers) - rust-lang#136598 (Fix suggestion for `dependency_on_unit_never_type_fallback` involving closures + format args expansions) - rust-lang#136653 (Remove dead code from rustc_codegen_llvm and the LLVM wrapper) - rust-lang#136664 (replace one `.map_or(true, ...)` with `.is_none_or(...)`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136653 - dpaoliello:cleanllvm1, r=Zalathar Remove dead code from rustc_codegen_llvm and the LLVM wrapper First step to clean up the LLVM wrapper: remove existing dead code. Split out of rust-lang#135502 r? ``@Zalathar``
First step to clean up the LLVM wrapper: remove existing dead code.
Split out of #135502
r? @Zalathar