Commit Graph

21 Commits

Author SHA1 Message Date
Derek Bankieris
1dbeb3e2d4 Fix io code for classes with excluded parents
Check the return value of CXXRecordVisitor::TraverseCXXRecordDecl and
don't add information from excluded parents.
Add a parameter to PrintAttributes::isHeaderExcluded to toggle exlusion
of TRICK_EXT_LIB_DIRS paths. When traversing a CXX record, we don't
actually want to skip these paths since their io code should exist in
the Trickified library.
Fix memory leak.

Refs #435
2017-05-24 10:51:27 -05:00
Derek Bankieris
73cbbd96cd Refactor ICG to report skipped files consistently
Refs #394
2017-03-15 15:53:56 -05:00
Alex Lin
a1bc45548b tool for detecting mismatch between friend init_attr and containing class #371
Added a check and warning message in ICG that warns you if a friend function
starts with "init_attr" but does not match the current class name.
2017-03-10 09:38:33 -06:00
Alex Lin
38d2b10b9e Forward-declared classes aren't fully populated in S_sie.resource #378
I chose the wrong call when trying to support clang 3.9 and it's
removal of getRBraceLoc.  The best equivalent call in 3.9 is
getBraceRange().getEnd().
2017-01-23 17:48:16 -06:00
Alex Lin
d875f837f2 ICG produces non-compilable io_* code for this weird example #334
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.
2016-11-02 13:56:40 -05:00
Derek Bankieris
ef1405c3be Refactor ICG
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
2016-10-28 14:37:12 -05:00
Alex Lin
ba75f6ff37 ICG does not compile using llvm 3.9 #339
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.
2016-10-28 13:21:21 -05:00
Alex Lin
f1cbacd646 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.
2016-10-21 13:13:43 -05:00
Alex Lin
c134ffea8f Merge branch '17.0' 2016-09-16 08:43:47 -05:00
Alex Lin
ae07b26243 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.
2016-09-16 08:39:37 -05:00
Alex Lin
b2432fd269 Trickified Project Libraries #309
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.
2016-09-15 14:48:23 -05:00
Alex Lin
d6e01ee1c4 Ignore privacy
We need to exclude STL or other template io_src code being created with they use
a protected/private enumerations, just like classes.  Also remove a check for
a static bitfield, because you can't have a static bitfield.

refs #218
2016-04-15 15:01:14 -05:00
Alex Lin
54591ec005 Ignore privacy
Found some of those uncommon cases like inheriting from templates which contain
private embedded classes.

refs #218
2016-04-13 16:07:16 -05:00
Alex Lin
f63f44d876 Ignore privacy
Changed the storage of offsets from bytes to bits to better handle bitfields.
Added code to track classes that are defined within other classes and are
private/protected.  These classes cannot be used in templates because our
io_src code declares variables outside of the class that would try and use
these private/protected variables.  When a template is found to use a
private/protected class it is skipped.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
314e962edf Ignore privacy
Removed the requirement of passing flags throughout ICG indicating if we are
in an inherited class or not.  Removed the init_attr friends throughout
Trick core headers.
2016-04-13 16:07:15 -05:00
Alex Lin
34090169fb Ignore privacy
Adjusted code to ignore processing templates in files with ICG:(No).  This
was not being honoroed before.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
4dad11bf45 Ignore privacy
Moved field offset calculations for inherited classes to when the inherited
classes are processed.  This removes the need to have to remember if fields
were inherited or not, the offset already reflects the correct offset.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
7dcc65d0bd Ignore privacy
Mostly working.  This removes the use of offsetof from all I/O code.  This was
the only reason we needed friends.  In it's place we put the offset value that
clang has calculated for the field.  Still need to work on virtually inherited
classes and confirm bitfields.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
ce3ae67633 ATTRIBUTES for a member whose type is typedef'd in a template are wrong
I found that in ICG I have access to the canonical type of a variable which
in most cases is the type I should process.  Doing this eliminates the
need for some of the code that resolved typedefs because the canonical type
has already done that.

refs #200
2016-03-16 13:24:59 -05:00
Alex Lin
952b899093 ICG doesn't handle inherited template classes correctly
When a template is in a namespace the type that is marked for the node containing
the full definition of the type is elaborated.  We need to go into
the elaborated name and get the underlying type.  Added code to do this
and tests to see if the type we are checking is itself a template or the
elaborated type is a template.  Sorry, this probably only makes sense to me.

refs #124
2015-09-18 13:18:05 -05:00
Alex Lin
f0c594f841 Initial commit of everything. 2015-02-26 09:02:31 -06:00