@@ -46,15 +46,13 @@ use stable_mir::mir::mono::{Instance, MonoItem};
4646use stable_mir:: { CrateDef , DefId } ;
4747use std:: any:: Any ;
4848use std:: collections:: BTreeMap ;
49- use std:: ffi:: OsString ;
5049use std:: fmt:: Write ;
5150use std:: fs:: File ;
5251use std:: io:: BufWriter ;
53- use std:: path:: { Path , PathBuf } ;
54- use std:: process:: Command ;
52+ use std:: path:: Path ;
5553use std:: sync:: { Arc , Mutex } ;
5654use std:: time:: Instant ;
57- use tracing:: { debug, error , info} ;
55+ use tracing:: { debug, info} ;
5856
5957pub type UnsupportedConstructs = FxHashMap < InternedString , Vec < Location > > ;
6058
@@ -204,12 +202,7 @@ impl GotocCodegenBackend {
204202 if !tcx. sess . opts . unstable_opts . no_codegen && tcx. sess . opts . output_types . should_codegen ( ) {
205203 let pretty = self . queries . lock ( ) . unwrap ( ) . args ( ) . output_pretty_json ;
206204 write_file ( & symtab_goto, ArtifactType :: PrettyNameMap , & pretty_name_map, pretty) ;
207- if gcx. queries . args ( ) . write_json_symtab {
208- write_file ( & symtab_goto, ArtifactType :: SymTab , & gcx. symbol_table , pretty) ;
209- symbol_table_to_gotoc ( & tcx, & symtab_goto) ;
210- } else {
211- write_goto_binary_file ( symtab_goto, & gcx. symbol_table ) ;
212- }
205+ write_goto_binary_file ( symtab_goto, & gcx. symbol_table ) ;
213206 write_file ( & symtab_goto, ArtifactType :: TypeMap , & type_map, pretty) ;
214207 // If they exist, write out vtable virtual call function pointer restrictions
215208 if let Some ( restrictions) = vtable_restrictions {
@@ -538,40 +531,6 @@ fn codegen_results(
538531 ) )
539532}
540533
541- fn symbol_table_to_gotoc ( tcx : & TyCtxt , base_path : & Path ) -> PathBuf {
542- let output_filename = base_path. to_path_buf ( ) ;
543- let input_filename = convert_type ( base_path, ArtifactType :: SymTabGoto , ArtifactType :: SymTab ) ;
544-
545- let args = vec ! [
546- input_filename. clone( ) . into_os_string( ) ,
547- "--out" . into( ) ,
548- OsString :: from( output_filename. as_os_str( ) ) ,
549- ] ;
550- // TODO get symtab2gb path from self
551- let mut cmd = Command :: new ( "symtab2gb" ) ;
552- cmd. args ( args) ;
553- info ! ( "[Kani] Running: `{:?} {:?}`" , cmd. get_program( ) , cmd. get_args( ) ) ;
554-
555- let result = with_timer (
556- || {
557- cmd. output ( )
558- . expect ( & format ! ( "Failed to generate goto model for {}" , input_filename. display( ) ) )
559- } ,
560- "symtab2gb" ,
561- ) ;
562- if !result. status . success ( ) {
563- error ! ( "Symtab error output:\n {}" , String :: from_utf8_lossy( & result. stderr) ) ;
564- error ! ( "Symtab output:\n {}" , String :: from_utf8_lossy( & result. stdout) ) ;
565- let err_msg = format ! (
566- "Failed to generate goto model:\n \t symtab2gb failed on file {}." ,
567- input_filename. display( )
568- ) ;
569- tcx. dcx ( ) . err ( err_msg) ;
570- tcx. dcx ( ) . abort_if_errors ( ) ;
571- } ;
572- output_filename
573- }
574-
575534pub fn write_file < T > ( base_path : & Path , file_type : ArtifactType , source : & T , pretty : bool )
576535where
577536 T : serde:: Serialize ,
0 commit comments