@@ -59,34 +59,18 @@ impl<'tcx> GotocCtx<'tcx> {
5959 pub fn symbol_name ( & self , instance : Instance < ' tcx > ) -> String {
6060 let llvm_mangled = self . tcx . symbol_name ( instance) . name . to_string ( ) ;
6161 debug ! (
62- "finding function name for instance: {}, debug: {:?}, name: {}, symbol: {}, demangle: {} " ,
62+ "finding function name for instance: {}, debug: {:?}, name: {}, symbol: {}" ,
6363 instance,
6464 instance,
6565 self . readable_instance_name( instance) ,
6666 llvm_mangled,
67- rustc_demangle:: demangle( & llvm_mangled) . to_string( )
6867 ) ;
6968
7069 let pretty = self . readable_instance_name ( instance) ;
7170
72- // Make main function a special case for easy CBMC entry
73- // TODO: probably need to edit for https://github.com/model-checking/kani/issues/169
74- if pretty == "main" {
75- "main" . to_string ( )
76- } else {
77- // TODO: llvm mangled string is not very readable. one way to tackle this is to
78- // demangle it. but the demangled string has no generic info.
79- // the best scenario is to use v0 mangler, but this is not default at this moment.
80- // this is the kind of tiny but annoying issue.
81- // c.f. https://github.com/rust-lang/rust/issues/60705
82- //
83- // the following solution won't work pretty:
84- // match self.tcx.sess.opts.debugging_opts.symbol_mangling_version {
85- // SymbolManglingVersion::Legacy => llvm_mangled,
86- // SymbolManglingVersion::V0 => rustc_demangle::demangle(llvm_mangled.as_str()).to_string(),
87- // }
88- llvm_mangled
89- }
71+ // Make main function a special case in order to support `--function main`
72+ // TODO: Get rid of this: https://github.com/model-checking/kani/issues/2129
73+ if pretty == "main" { pretty } else { llvm_mangled }
9074 }
9175
9276 /// The name for a tuple field
0 commit comments