mirror of
https://github.com/nasa/trick.git
synced 2025-06-22 00:41:52 +00:00
Detect when TRICK_ICG is used in header files and compensate for it. #375
Created a hook for the clang preprocessor. The hook does 2 things. It keeps track to which header files we have entered and exited. Second it searches for the use of TRICK_ICG. If we find an instance of TRICK_ICG we mark all of the included files from this point up the chain as requiring compensation. To compensate for using TRICK_ICG we write out the older offset statements to get the location of variables in classes/structures.
This commit is contained in:
@ -201,27 +201,6 @@ void PrintFileContents10::print_init_attr_func( std::ostream & ostream , ClassVa
|
||||
<< " }\n"
|
||||
<< " initialized = 1;\n\n" ;
|
||||
|
||||
#if 0
|
||||
if ( cv->getMangledTypeName() != cv->getName() ) {
|
||||
ostream << " typedef " << cv->getName() << " " << cv->getMangledTypeName() << " ;\n\n" ;
|
||||
}
|
||||
|
||||
if ( !global_compat15 and !cv->isCompat15()) {
|
||||
ostream << " if ( sizeof(" ;
|
||||
printNamespaces( ostream, cv , "::" ) ;
|
||||
printContainerClasses( ostream, cv , "::" ) ;
|
||||
ostream << cv->getName() << ") > " << cv->getSize() << ") {\n" ;
|
||||
ostream << " Trick::ClassSizeCheck::class_size_check()->add_diff(\"" ;
|
||||
printNamespaces( ostream, cv , "::" ) ;
|
||||
printContainerClasses( ostream, cv , "::" ) ;
|
||||
ostream << cv->getName() << "\" , Trick::ClassSizeDiffInfo((sizeof(" ;
|
||||
printNamespaces( ostream, cv , "::" ) ;
|
||||
printContainerClasses( ostream, cv , "::" ) ;
|
||||
ostream << cv->getName() << ") - " << cv->getSize() << ") , \"" << cv->getFileName() << "\")) ;\n" ;
|
||||
ostream << " }\n" ;
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned int ii = 0;
|
||||
for ( auto field : cv->getFieldDescriptions() ) {
|
||||
if ( determinePrintAttr(cv, field) ) {
|
||||
|
Reference in New Issue
Block a user