about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--example/std_example.rs6
-rwxr-xr-xscripts/test_rustc_tests.sh2
-rw-r--r--src/base.rs2
-rw-r--r--src/common.rs3
-rw-r--r--src/constant.rs2
-rw-r--r--src/debuginfo/line_info.rs15
-rw-r--r--src/debuginfo/mod.rs17
7 files changed, 36 insertions, 11 deletions
diff --git a/example/std_example.rs b/example/std_example.rs
index 490cc2404f6..9bd2ab5c638 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -1,7 +1,7 @@
 #![feature(
     core_intrinsics,
-    generators,
-    generator_trait,
+    coroutines,
+    coroutine_trait,
     is_sorted,
     repr_simd,
     tuple_trait,
@@ -12,7 +12,7 @@
 use std::arch::x86_64::*;
 use std::hint::black_box;
 use std::io::Write;
-use std::ops::Generator;
+use std::ops::Coroutine;
 
 fn main() {
     println!("{:?}", std::env::args().collect::<Vec<_>>());
diff --git a/scripts/test_rustc_tests.sh b/scripts/test_rustc_tests.sh
index 68d4a29bab4..738701c6409 100755
--- a/scripts/test_rustc_tests.sh
+++ b/scripts/test_rustc_tests.sh
@@ -152,7 +152,7 @@ rm -r tests/run-make/compressed-debuginfo
 
 rm -r tests/run-make/extern-fn-explicit-align # argument alignment not yet supported
 
-rm tests/ui/codegen/subtyping-enforces-type-equality.rs # assert_assignable bug with Generator's
+rm tests/ui/codegen/subtyping-enforces-type-equality.rs # assert_assignable bug with Coroutine's
 
 # bugs in the test suite
 # ======================
diff --git a/src/base.rs b/src/base.rs
index ac7389792c8..80e7c5bd9ed 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -478,7 +478,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
             TerminatorKind::Yield { .. }
             | TerminatorKind::FalseEdge { .. }
             | TerminatorKind::FalseUnwind { .. }
-            | TerminatorKind::GeneratorDrop => {
+            | TerminatorKind::CoroutineDrop => {
                 bug!("shouldn't exist at codegen {:?}", bb_data.terminator());
             }
             TerminatorKind::Drop { place, target, unwind: _, replace: _ } => {
diff --git a/src/common.rs b/src/common.rs
index 8958369267e..7a3ae6ebf52 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -414,11 +414,12 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
     // Note: must be kept in sync with get_caller_location from cg_ssa
     pub(crate) fn get_caller_location(&mut self, mut source_info: mir::SourceInfo) -> CValue<'tcx> {
         let span_to_caller_location = |fx: &mut FunctionCx<'_, '_, 'tcx>, span: Span| {
+            use rustc_session::RemapFileNameExt;
             let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span);
             let caller = fx.tcx.sess.source_map().lookup_char_pos(topmost.lo());
             let const_loc = fx.tcx.const_caller_location((
                 rustc_span::symbol::Symbol::intern(
-                    &caller.file.name.prefer_remapped().to_string_lossy(),
+                    &caller.file.name.for_codegen(&fx.tcx.sess).to_string_lossy(),
                 ),
                 caller.line as u32,
                 caller.col_display as u32 + 1,
diff --git a/src/constant.rs b/src/constant.rs
index 1cb6fa07723..b0853d30e03 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -510,7 +510,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
                     | TerminatorKind::Drop { .. }
                     | TerminatorKind::Assert { .. } => {}
                     TerminatorKind::Yield { .. }
-                    | TerminatorKind::GeneratorDrop
+                    | TerminatorKind::CoroutineDrop
                     | TerminatorKind::FalseEdge { .. }
                     | TerminatorKind::FalseUnwind { .. } => unreachable!(),
                     TerminatorKind::InlineAsm { .. } => return None,
diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs
index d00d19f9a80..6230ca15d6e 100644
--- a/src/debuginfo/line_info.rs
+++ b/src/debuginfo/line_info.rs
@@ -95,7 +95,11 @@ impl DebugContext {
         match &source_file.name {
             FileName::Real(path) => {
                 let (dir_path, file_name) =
-                    split_path_dir_and_file(path.remapped_path_if_available());
+                    split_path_dir_and_file(if self.should_remap_filepaths {
+                        path.remapped_path_if_available()
+                    } else {
+                        path.local_path_if_available()
+                    });
                 let dir_name = osstr_as_utf8_bytes(dir_path.as_os_str());
                 let file_name = osstr_as_utf8_bytes(file_name);
 
@@ -116,7 +120,14 @@ impl DebugContext {
             filename => {
                 let dir_id = line_program.default_directory();
                 let dummy_file_name = LineString::new(
-                    filename.prefer_remapped().to_string().into_bytes(),
+                    filename
+                        .display(if self.should_remap_filepaths {
+                            FileNameDisplayPreference::Remapped
+                        } else {
+                            FileNameDisplayPreference::Local
+                        })
+                        .to_string()
+                        .into_bytes(),
                     line_program.encoding(),
                     line_strings,
                 );
diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs
index dd0c14dae23..e6edc452cfb 100644
--- a/src/debuginfo/mod.rs
+++ b/src/debuginfo/mod.rs
@@ -31,6 +31,8 @@ pub(crate) struct DebugContext {
 
     dwarf: DwarfUnit,
     unit_range_list: RangeList,
+
+    should_remap_filepaths: bool,
 }
 
 pub(crate) struct FunctionDebugContext {
@@ -63,12 +65,18 @@ impl DebugContext {
 
         let mut dwarf = DwarfUnit::new(encoding);
 
+        let should_remap_filepaths = tcx.sess.should_prefer_remapped_for_codegen();
+
         let producer = producer();
         let comp_dir = tcx
             .sess
             .opts
             .working_dir
-            .to_string_lossy(FileNameDisplayPreference::Remapped)
+            .to_string_lossy(if should_remap_filepaths {
+                FileNameDisplayPreference::Remapped
+            } else {
+                FileNameDisplayPreference::Local
+            })
             .into_owned();
         let (name, file_info) = match tcx.sess.local_crate_source_file() {
             Some(path) => {
@@ -102,7 +110,12 @@ impl DebugContext {
             root.set(gimli::DW_AT_low_pc, AttributeValue::Address(Address::Constant(0)));
         }
 
-        DebugContext { endian, dwarf, unit_range_list: RangeList(Vec::new()) }
+        DebugContext {
+            endian,
+            dwarf,
+            unit_range_list: RangeList(Vec::new()),
+            should_remap_filepaths,
+        }
     }
 
     pub(crate) fn define_function(