-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is Trick ICG missing some uses of TRICK_ICG #608
Comments
Yes, it is, it's missing all of them. Any clang/llvm version 3.5 and above. So it's been broken for a while. We inherit from a clang class that processes preprocessing statements. If we override virtual functions of a certain signature, we can inject our code into the preprocessing process. In this case we're looking for the use of TRICK_ICG. Clang changed the function signature in version 3.5. From 3.5 on our functions were never called, so we never would find TRICK_ICG. I created new signatures for the functions post 3.5 so they will work again.
Some functions changed signatures in 3.5, others in 3.7.
Probably not getting the following syntax still:
|
In the example below, Foo.hh // @trick_parse{everything}
#ifndef FOO_HH
#define FOO_HH
class Foo {
#ifndef TRICK_ICG
int i;
int j;
int k;
#endif
};
#endif Bar.hh // @trick_parse{everything}
#include "Foo.hh"
class Bar {
public:
Foo foo;
int i;
}; Baz.hh // @trick_parse{everything}
#include "Foo.hh"
class Baz {
public:
Foo foo;
int i;
}; io_Bar.cpp void init_attrBar() {
static int initialized ;
if (initialized) {
return;
}
initialized = 1;
attrBar[0].offset = offsetof(Bar, foo) ;
trick_MM->add_attr_info(std::string(attrBar[0].type_name) , &attrBar[0], __FILE__ , __LINE__ ) ;
attrBar[1].offset = offsetof(Bar, i) ;
} io_Baz.pp void init_attrBaz() {
static int initialized ;
if (initialized) {
return;
}
initialized = 1;
trick_MM->add_attr_info(std::string(attrBaz[0].type_name) , &attrBaz[0], __FILE__ , __LINE__ ) ;
} I haven't found anything about disabling multiple-include optimization (which would impact build speed anyway), so we'll probably have to add some more smarts to ICG. |
…d include chains for headers that have already been preprocessed
…each #1125 , remove memory leak on a cstr
Test to see if Trick is catching the use of TRICK_ICG in this statement
We may be missing this case, and only on the Mac.
The text was updated successfully, but these errors were encountered: