@@ -15,7 +15,7 @@ use crate::maybe_pqp_cg_ssa as rustc_codegen_ssa;
1515
1616use itertools:: Itertools as _;
1717use rspirv:: dr:: { Module , Operand } ;
18- use rspirv:: spirv:: { Decoration , LinkageType , Op , Word } ;
18+ use rspirv:: spirv:: { Decoration , LinkageType , Word } ;
1919use rustc_abi:: { AddressSpace , HasDataLayout , TargetDataLayout } ;
2020use rustc_ast:: ast:: { InlineAsmOptions , InlineAsmTemplatePiece } ;
2121use rustc_codegen_ssa:: mir:: debuginfo:: { FunctionDebugContext , VariableKind } ;
@@ -37,7 +37,7 @@ use rustc_target::spec::{HasTargetSpec, Target, TargetTuple};
3737use std:: cell:: RefCell ;
3838use std:: collections:: BTreeSet ;
3939use std:: iter:: once;
40- use std:: path:: { Path , PathBuf } ;
40+ use std:: path:: PathBuf ;
4141use std:: rc:: Rc ;
4242use std:: str:: FromStr ;
4343
@@ -767,25 +767,6 @@ impl CodegenArgs {
767767
768768 if self . disassemble_globals {
769769 for inst in module. global_inst_iter ( ) {
770- // HACK: On Windows, paths are printed like `OpString "D:\\dir\\blah"`.
771- // Unfortunately, compiletest will only normalize `D:\dir\blah` to `$DIR/blah` -
772- // one backslash, not two. So, when disassembling for compiletest, check if the
773- // argument to OpString can be parsed as an absolute path, and if it is, replace it
774- // with just the filename component of the path.
775- if inst. class . opcode == Op :: String {
776- let path = Path :: new ( inst. operands [ 0 ] . unwrap_literal_string ( ) ) ;
777- if path. is_absolute ( )
778- && let Some ( file_name) = path. file_name ( )
779- {
780- let mut inst = inst. clone ( ) ;
781- inst. operands [ 0 ] = Operand :: LiteralString ( format ! (
782- "$OPSTRING_FILENAME/{}" ,
783- file_name. to_string_lossy( ) ,
784- ) ) ;
785- eprintln ! ( "{}" , inst. disassemble( ) ) ;
786- continue ;
787- }
788- }
789770 eprintln ! ( "{}" , inst. disassemble( ) ) ;
790771 }
791772 }
0 commit comments