This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Constructor parameters for global object initialization
- From: Philipp Schoppe <phil dot subscriptions at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 29 Nov 2013 16:32:38 +0100
- Subject: Constructor parameters for global object initialization
- Authentication-results: sourceware.org; auth=none
Hello,
I just started with developping GCC plugins. It works pretty well,
but there is one case I cannot seem to work out and I don't
find any specific information about it in the internet and GCC
internals docs.
In the case of test.cpp:
class test {
public:
test(int i) { _x = i; }
private:
int _x;
};
test glob_test(4);
int main() {
return 0;
}
How can I get the constructor statement of the VAR_DECL glob_test
and the given parameters? There seems to be no direct access to
any sort of constructor node and no __static_initialization..
FUNCTION_DECL seems to provide this information. debug_tree() does
not provide any hints on where the constructor information can be
found.
Kind regards,
Philipp