mirror of
https://github.com/nasa/trick.git
synced 2025-06-21 08:29:39 +00:00
ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Added back the code that set the offset of variables with the offsetof function. This code is running by default. Any code that includes #ifndef TRICK_ICG in classes/structures will want this on. Added a flag to ICG that allows us to turn off writing of these lines. If the flag is present, ICG may write out io_src code for private/protected variables that it could not reach if an offsetof function was required. Code cannot have any #ifndef TRICK_ICG present in classes/structures for this to work.
This commit is contained in:
@ -37,9 +37,11 @@ ut_system * FieldDescription::u_system = get_u_system() ;
|
||||
FieldDescription::FieldDescription(
|
||||
std::string in_container_class ) :
|
||||
container_class(in_container_class) ,
|
||||
base_class_offset(0) ,
|
||||
field_offset(0) ,
|
||||
field_width(0) ,
|
||||
inherited(false) ,
|
||||
virtual_inherited(false) ,
|
||||
units("1") ,
|
||||
is_dashdash(false) ,
|
||||
line_no(0) ,
|
||||
@ -314,6 +316,14 @@ void FieldDescription::setContainerClass(std::string in_name ) {
|
||||
container_class = in_name ;
|
||||
}
|
||||
|
||||
void FieldDescription::setBaseClassOffset(unsigned int in_offset) {
|
||||
base_class_offset = in_offset ;
|
||||
}
|
||||
|
||||
unsigned int FieldDescription::getBaseClassOffset() {
|
||||
return base_class_offset ;
|
||||
}
|
||||
|
||||
void FieldDescription::setFieldOffset(unsigned int in_offset) {
|
||||
field_offset = in_offset ;
|
||||
}
|
||||
@ -393,6 +403,14 @@ bool FieldDescription::isInherited() {
|
||||
return inherited ;
|
||||
}
|
||||
|
||||
void FieldDescription::setVirtualInherited(bool in_inherited) {
|
||||
virtual_inherited = in_inherited ;
|
||||
}
|
||||
|
||||
bool FieldDescription::isVirtualInherited() {
|
||||
return virtual_inherited ;
|
||||
}
|
||||
|
||||
void FieldDescription::setAccess( clang::AccessSpecifier in_val ) {
|
||||
access = in_val ;
|
||||
}
|
||||
|
Reference in New Issue
Block a user