This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC Plugin: Initialize an Array Global Variable
- From: Stephan Friedl <stephanf01 at yahoo dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 1 Aug 2014 12:14:12 -0700
- Subject: GCC Plugin: Initialize an Array Global Variable
- Authentication-results: sourceware.org; auth=none
- Reply-to: Stephan Friedl <stephanf01 at yahoo dot com>
I am implementing a GCC Plugin to perform some simple operations, one of which is to create and initialize global variables. I have this working for fundamental values and for creating class instances and then invoking their constructor with appropriate arguments during static initialization.
What currently has me stalled is initializing global array variables. I can create the variables but have not yet uncovered how to initialize them. I have tried calling DECL_INITIAL with references to array locations but that does not appear to work.
Can anybody give me some insight into how to initialize a global array and/or point me to some example code?
Thanks,
Stephan