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.
When saving the list of namespaces and classes a particular type is contained in
we have to save the class name and any template args it includes separately. This
allows us to mangle the names easier. And we now search for type names to see
if they follow this pattern template_name<template_args>::embedded_class. If
we are using a template embedded class we need to create attributes for the embedded class.
Calling getTemplateArgs() every iteration is wasteful. This should
be done once outside of the loop. Even better, use a foreach loop and
get rid of the index varible!
Hey buddy. I wanted to tell you this before you heard it from someone
else...
I refactored ICG.
Now, it's gonna look a little scary at first. But I promise you'll like
it when you get used to it. It'll be fine. You can trust me. #341
The call getRBraceLoc to find the ending source location of things is gone. Replaced
it with getting the source range and get the end of that range. Also the way to
get clang/llvm 3.9 to process c++11 code required some reordering of calls in main as
well as adding some more features to be turned on.
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.
Added a check that was in 15 that tested the platform we are running on. If we
are on an mac, we want to skip fully qualifying variable names because it creates
code that doesn't compile under clang.
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.
We were ignoring classes completely if it was found in to be in an external library
directory. We need to partially process it so it is included in the ICG generated
class_map file which registers attributes of classes and eventually works it's way
to populating the S_sie file.
Once we determine the type of a variable we should stop processing the
AST tree at that point. We do this for record types but not for the
built in types. Changed the return value of the process builtin
function to false so we stop processing.
So using consts as arguments to STLs causes errors in our io code and SWIG.
Added a check for const template arguments and going to ignore them for
both ICG and what we input to SWIG.
Created man pages for each executable we have in bin. Updated the
couple of man pages we did have in there. Modified trick-CP
to accept arguments. Updated the version number reported by ICG
as well.
Modified the makefile to define LIBCLANG_MAJOR, LIBCLANG_MINOR, and
LIBCLANG_PATCHLEVEL based on the llvm-config executable in the llvm
directory pointed to by the configuration. These new variable names
are independent of the __clang_major__, etc. variables we were defining
only in Linux. Using these names, we can reduce the clang version
checks to a single consistent set of version numbers. We don't have
to deal with the different version numbers assigned by Apple.
Removed the lines that set the compiler to clang++, defaulting
it to g++. Added lines in the makefile to set __clang_major__,
__clang_minor__, and __clang_patchlevel__. These are required
to compile several of the files in the ICG directory.
refs #259
Set LD in our makefiles to the ld executable found by configure.
Changed the final sim link to use TRICK_CPPC as the link command since
it was using the compiler anyways. Changed the places where we use "ld" to
use LD.
refs #131
Used the mods field in the attributes to indicate of "--" was specified in the header file. We
still save the units as "1" to keep it compatible with udunits. When outputting the variable
in data recording or variable server we check to see if the mods field for "--" is set. We
output "--" if the mods field is set. Also allowed "--" to persist in data products.
refs #254
Added a makefile install rule to copy the header files out of
er7_utils to the install directory. Adjusted ICG to ignore
Trick header files if they are installed.
refs #246