ICG creates offsetof statements that will not compile when using clang #327

When copying inherited variables to a child class in ICG, the inherited flags
were not being set on the mac.
This commit is contained in:
Alex Lin 2016-10-21 10:04:07 -05:00
parent f1cbacd646
commit a2452aacd0

View File

@ -57,6 +57,16 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
std::vector<FieldDescription *>::iterator fdit ;
// Loop through the incoming inherited variable names
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) {
(*fdit)->setBaseClassOffset( class_offset ) ;
(*fdit)->setInherited( true ) ;
(*fdit)->setVirtualInherited( virtual_inherited ) ;
// Adds the class offset to the field offset giving the total offset to the inherited variable
// The offset is stored in bits so multiply class_offset by 8.
(*fdit)->addOffset( class_offset * 8 ) ;
}
#ifdef __APPLE__
if ( !global_compat15 and !compat15 ) {
#else
@ -64,13 +74,6 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
#endif
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) {
(*fdit)->setBaseClassOffset( class_offset ) ;
(*fdit)->setInherited( true ) ;
(*fdit)->setVirtualInherited( virtual_inherited ) ;
// Adds the class offset to the field offset giving the total offset to the inherited variable
// The offset is stored in bits so multiply class_offset by 8.
(*fdit)->addOffset( class_offset * 8 ) ;
std::string in_name = (*fdit)->getName() ;
// search existing names for incoming inherited variable name.
std::map< std::string , FieldDescription * >::iterator mit = field_name_to_info_map.find(in_name) ;