From 2fa76ce704c154a76fa375986cbde76777e95695 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Wed, 25 Mar 2015 15:50:55 -0500 Subject: [PATCH 1/2] Remove dependency on perl Data::Dumper Removed all references to Data::Dumper. Only one module was even using the Data::Dumper. Fixes #30. --- bin/C3PO | 14 -------------- bin/MIS | 1 - bin/pm/ICG.pm | 1 - bin/pm/MIS.pm | 1 - bin/start_sim | 2 -- 5 files changed, 19 deletions(-) diff --git a/bin/C3PO b/bin/C3PO index 08885776..18eeda28 100755 --- a/bin/C3PO +++ b/bin/C3PO @@ -3,7 +3,6 @@ use File::Basename ; use Cwd ; use strict ; -use Data::Dumper ; use Getopt::Long ; use Pod::Usage ; use Pod::Text ; @@ -230,24 +229,11 @@ undef %temp_hash ; @all_src_files = grep ++$temp_hash{$_} < 2, @all_src_files ; @all_src_files = grep !/trick_source|\.a$|^\-/ , @all_src_files ; -# TODO: Add back at some time before release -#trick_print($sim{fh}, "MIS-ing all src files... ", "title_cyan" , $sim{args}{v}) ; -#trick_print($sim{fh}, "\n" , "title_white" , $sim{args}{v}) if ( $sim{args}{v} != 1 ) ; -#mis_all_c(\@all_src_files , \%sim ) ; - if ( $sim{args}{v} == 1 ) { print " Complete\n" ; } trick_print($sim{fh}, "\nMIS complete\n\n" , "normal_green" , $sim{args}{v}) ; -if ( $sim{args}{v} > 3 ) { - chdir ($cwd) ; - $Data::Dumper::Indent = 1 ; - open FILE, ">sim_info" or die "Couldn't open sim_info\n"; - print FILE Data::Dumper->Dump([\%sim], ["*sim_info"]) , "\n" ; - close FILE ; -} - #-------------------------------------------------------------- # Make Default Data diff --git a/bin/MIS b/bin/MIS index 9d576ca8..38ea2b8a 100755 --- a/bin/MIS +++ b/bin/MIS @@ -7,7 +7,6 @@ use Getopt::Long ; use Pod::Usage ; use Pod::Text ; use File::Basename ; -use Data::Dumper ; use Cwd ; use Cwd 'abs_path' ; use mis_dep ; diff --git a/bin/pm/ICG.pm b/bin/pm/ICG.pm index 2c1902ee..915d08f7 100644 --- a/bin/pm/ICG.pm +++ b/bin/pm/ICG.pm @@ -14,7 +14,6 @@ use MIS ; use html ; use trick_print ; use trick_version ; -use Data::Dumper ; use Cwd 'abs_path'; ############################################################################## diff --git a/bin/pm/MIS.pm b/bin/pm/MIS.pm index a53a637d..5fa5e118 100644 --- a/bin/pm/MIS.pm +++ b/bin/pm/MIS.pm @@ -7,7 +7,6 @@ use Exporter (); use strict ; use lib $ENV{"TRICK_HOME"} . "/bin/pm" ; use File::Basename ; -use Data::Dumper ; use Cwd ; use Cwd 'abs_path' ; use html ; diff --git a/bin/start_sim b/bin/start_sim index e86af978..0be75e83 100755 --- a/bin/start_sim +++ b/bin/start_sim @@ -21,8 +21,6 @@ use gte ; #use strict ; require $ENV{"TRICK_HOME"} . "/bin/pm/XML/Parser.pm" ; use XML::Simple ; -use Data::Dumper ; - my @element_stack; my $record_index; From 3e0abdddc5e9096cbfd47498844198081dbe447a Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Wed, 25 Mar 2015 15:58:33 -0500 Subject: [PATCH 2/2] Checkpoints cannot handle overloaded names When a field is processed in a class it is added to a list. This list will contain the fields from base classes the current class inherits from. We check the list of fields we inherited, if we find that the current field overloads the name of an inherited field we adjust the inherited field's name to be shown as the fully qualified name in io_src code. Fixes #31 --- .../codegen/Interface_Code_Gen/ClassValues.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/trick_source/codegen/Interface_Code_Gen/ClassValues.cpp b/trick_source/codegen/Interface_Code_Gen/ClassValues.cpp index 365e9dc7..e8aef4f5 100644 --- a/trick_source/codegen/Interface_Code_Gen/ClassValues.cpp +++ b/trick_source/codegen/Interface_Code_Gen/ClassValues.cpp @@ -28,6 +28,19 @@ ClassValues::~ClassValues() { void ClassValues::addFieldDescription(FieldDescription * in_fdes) { field_descripts.push_back(in_fdes) ; + + // Test to see if the new field overloads a field of the same name. If it does + // then fully qualify the name of the inherited field (the one already in field_name_to_info). + std::map< std::string , FieldDescription * >::iterator mit = field_name_to_info_map.find(in_fdes->getName()) ; + if ( mit != field_name_to_info_map.end() ) { + // If the matched variable is inherited, qualify it with its container class name. + if ( (*mit).second->isInherited() ) { + (*mit).second->setName( (*mit).second->getContainerClass() + "::" + (*mit).second->getName() ) ; + field_name_to_info_map[(*mit).second->getName()] = (*mit).second ; + field_name_to_info_map.erase(mit) ; + } + } + field_name_to_info_map[in_fdes->getName()] = in_fdes ; }