Replace target.target with target and target.ptr_width with target.pointer_width
Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.
On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.
Result of running:
find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt
This commit is contained in:
@@ -67,5 +67,5 @@ pub fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
|
||||
|
||||
!omit_gdb_pretty_printer_section
|
||||
&& cx.sess().opts.debuginfo != DebugInfo::None
|
||||
&& cx.sess().target.target.options.emit_debug_gdb_scripts
|
||||
&& cx.sess().target.options.emit_debug_gdb_scripts
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ fn basic_type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
|
||||
|
||||
// When targeting MSVC, emit MSVC style type names for compatibility with
|
||||
// .natvis visualizers (and perhaps other existing native debuggers?)
|
||||
let msvc_like_names = cx.tcx.sess.target.target.options.is_like_msvc;
|
||||
let msvc_like_names = cx.tcx.sess.target.options.is_like_msvc;
|
||||
|
||||
let (name, encoding) = match t.kind() {
|
||||
ty::Never => ("!", DW_ATE_unsigned),
|
||||
@@ -985,7 +985,7 @@ pub fn compile_unit_metadata(
|
||||
// if multiple object files with the same `DW_AT_name` are linked together.
|
||||
// As a workaround we generate unique names for each object file. Those do
|
||||
// not correspond to an actual source file but that should be harmless.
|
||||
if tcx.sess.target.target.options.is_like_osx {
|
||||
if tcx.sess.target.options.is_like_osx {
|
||||
name_in_debuginfo.push("@");
|
||||
name_in_debuginfo.push(codegen_unit_name);
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ fn prepare_union_metadata(
|
||||
/// on MSVC we have to use the fallback mode, because LLVM doesn't
|
||||
/// lower variant parts to PDB.
|
||||
fn use_enum_fallback(cx: &CodegenCx<'_, '_>) -> bool {
|
||||
cx.sess().target.target.options.is_like_msvc
|
||||
cx.sess().target.options.is_like_msvc
|
||||
}
|
||||
|
||||
// FIXME(eddyb) maybe precompute this? Right now it's computed once
|
||||
|
||||
@@ -120,12 +120,12 @@ pub fn finalize(cx: &CodegenCx<'_, '_>) {
|
||||
// for macOS to understand. For more info see #11352
|
||||
// This can be overridden using --llvm-opts -dwarf-version,N.
|
||||
// Android has the same issue (#22398)
|
||||
if let Some(version) = cx.sess().target.target.options.dwarf_version {
|
||||
if let Some(version) = cx.sess().target.options.dwarf_version {
|
||||
llvm::LLVMRustAddModuleFlag(cx.llmod, "Dwarf Version\0".as_ptr().cast(), version)
|
||||
}
|
||||
|
||||
// Indicate that we want CodeView debug information on MSVC
|
||||
if cx.sess().target.target.options.is_like_msvc {
|
||||
if cx.sess().target.options.is_like_msvc {
|
||||
llvm::LLVMRustAddModuleFlag(cx.llmod, "CodeView\0".as_ptr().cast(), 1)
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
||||
});
|
||||
|
||||
// Arguments types
|
||||
if cx.sess().target.target.options.is_like_msvc {
|
||||
if cx.sess().target.options.is_like_msvc {
|
||||
// FIXME(#42800):
|
||||
// There is a bug in MSDIA that leads to a crash when it encounters
|
||||
// a fixed-size array of `u8` or something zero-sized in a
|
||||
|
||||
@@ -38,7 +38,7 @@ impl CodegenCx<'ll, '_> {
|
||||
// For MSVC, omit the column number.
|
||||
// Otherwise, emit it. This mimics clang behaviour.
|
||||
// See discussion in https://github.com/rust-lang/rust/issues/42921
|
||||
if self.sess().target.target.options.is_like_msvc {
|
||||
if self.sess().target.options.is_like_msvc {
|
||||
DebugLoc { file, line, col: None }
|
||||
} else {
|
||||
DebugLoc { file, line, col }
|
||||
|
||||
Reference in New Issue
Block a user