-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #135140 - jhpratt:rollup-pn2gi84, r=jhpratt
Rollup of 3 pull requests Successful merges: - #135115 (cg_llvm: Use constants for DWARF opcodes, instead of FFI calls) - #135118 (Clarified the documentation on `core::iter::from_fn` and `core::iter::successors`) - #135121 (Mark `slice::reverse` unstably const) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
11 changed files
with
72 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! Definitions of various DWARF-related constants. | ||
use libc::c_uint; | ||
|
||
/// Helper macro to let us redeclare gimli's constants as our own constants | ||
/// with a different type, with less risk of copy-paste errors. | ||
macro_rules! declare_constant { | ||
( | ||
$name:ident : $type:ty | ||
) => { | ||
#[allow(non_upper_case_globals)] | ||
pub(crate) const $name: $type = ::gimli::constants::$name.0 as $type; | ||
|
||
// Assert that as-cast probably hasn't changed the value. | ||
const _: () = assert!($name as i128 == ::gimli::constants::$name.0 as i128); | ||
}; | ||
} | ||
|
||
declare_constant!(DW_TAG_const_type: c_uint); | ||
|
||
// DWARF languages. | ||
declare_constant!(DW_LANG_Rust: c_uint); | ||
|
||
// DWARF attribute type encodings. | ||
declare_constant!(DW_ATE_boolean: c_uint); | ||
declare_constant!(DW_ATE_float: c_uint); | ||
declare_constant!(DW_ATE_signed: c_uint); | ||
declare_constant!(DW_ATE_unsigned: c_uint); | ||
declare_constant!(DW_ATE_UTF: c_uint); | ||
|
||
// DWARF expression operators. | ||
declare_constant!(DW_OP_deref: u64); | ||
declare_constant!(DW_OP_plus_uconst: u64); | ||
/// Defined by LLVM in `llvm/include/llvm/BinaryFormat/Dwarf.h`. | ||
/// Double-checked by a static assertion in `RustWrapper.cpp`. | ||
#[allow(non_upper_case_globals)] | ||
pub(crate) const DW_OP_LLVM_fragment: u64 = 0x1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters