ICG exclude of class member variables now defines incorrect memory offsets in io_src #311

This changes back the default behavior to not use offsetof in io_src code.
Added a flag to ICG, -c or --compat15, to globally generate offsetof statements.
Added an ENV variable that can be used to generate offsetof statements by file or directory.
Added in a warning if classes parsed at ICG time are different in size than at runtime.
This commit is contained in:
Alex Lin
2016-10-21 09:30:55 -05:00
parent 5484e39f11
commit f1cbacd646
13 changed files with 233 additions and 125 deletions

View File

@ -44,10 +44,8 @@ llvm::cl::list< std::string > sink(llvm::cl::Sink, llvm::cl::ZeroOrMore) ;
llvm::cl::list< std::string > pre_compiled_headers("include", llvm::cl::Prefix, llvm::cl::desc("pre-compiled headers"),
llvm::cl::value_desc("pre_compiled_headers")) ;
llvm::cl::opt< bool > no_offset_of ("n", llvm::cl::desc("Do not print the offsetof calculations in attributes")) ;
llvm::cl::alias no_offset_of_alias ("no-offset-of" , llvm::cl::desc("Alias for -n") , llvm::cl::aliasopt(no_offset_of)) ;
//llvm::cl::opt< bool > show_units ("u", llvm::cl::desc("List recognized units")) ;
llvm::cl::opt< bool > global_compat15 ("c", llvm::cl::desc("Print the offsetof calculations in attributes")) ;
llvm::cl::alias compat15_alias ("compat15" , llvm::cl::desc("Alias for -c") , llvm::cl::aliasopt(global_compat15)) ;
void ICG_version() {
std::cout << "Trick Interface Code Generator (trick-ICG) " << TRICK_VERSION << std::endl ;