Hi all,
If I have a FUNCTION_DECL node that returns non-null for
DECL_TEMPLATE_INFO() then it is a template or template instantiation.
How can I tell if it is a full instantiation (I.e. not general
template or partial specialisation)?
Does this also apply to nodes that represent template types
(s
Sorry about the separate email.
In addition to the previous questions I want to ask if there is a
better way of achieving finding the type nodes for a functions
exception specification list.
For each FUNCTION_DECL node I find, I want to determine what its
exception specification list is. I.e. the
Bob Rossi wrote:
> Hi Ian,
>
> Basically, I want to use GCC with C,C++. I want to walk a tree that GCC
> creates for the translation units. I would like to know if for these two
> languages if I should use a language dependent tree, the generic tree or
> the gimple tree. In general, I would like to
Hi all,
I have yet another question that has arisen as i have started testing my
code. Basically I am trying to get the type that is being used in
throwing an exception.
Is there a simple macro i can use to get the type of an exception from a
THROW_EXPR? I think this is a matter of getting the T
Richard Guenther wrote:
> On 10/14/06, Brendon Costa <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> I have yet another question that has arisen as i have started testing my
>> code. Basically I am trying to get the type that is being used in
>> throwing an exce
My GCC extension will never be merged with the GCC source I dont think
but will be distributed as a patch for GCC. So with that in mind do you
think there will be any functional issues for me to set the TREE_TYPE of
all THROW_EXPR nodes to have the type of the exception they are throwing
or void (a
Bob Rossi wrote:
>
> Thanks Brendon, that was really helpful. I'm very new at this, and may
> have some seemingly rather odd questions. I see that global_namespace is
> of type 'union tree_node'. Is this the C++ language dependent AST?
Yes, this is the C++ AST. I actually think it is just a supe
Ian Lance Taylor wrote:
> Brendon Costa <[EMAIL PROTECTED]> writes:
>
>> For each FUNCTION_DECL node I find, I want to determine what its
>> exception specification list is. I.e. the throws() statement in its
>> prototype.
>
> Look at TYPE_RAISES_EXCEPTIONS
Brendon Costa wrote:
> Ian Lance Taylor wrote:
>> Brendon Costa <[EMAIL PROTECTED]> writes:
>>
>>> For each FUNCTION_DECL node I find, I want to determine what its
>>> exception specification list is. I.e. the throws() statement in its
>>> prot
Hi again,
I have noticed in the C++ front end that classes have a few
__comp_ctor () functions. These functions do not have an
implementation that can be obtained with DECL_SAVED_TREE.
Looking further into it there are a number of identifiers for
functions like this added to cp_global_trees. I ha
Hi all,
How can I find a FUNCTION_DECL node from a CALL_EXPR node for virtual
function calls?
Note: I am not after the node for the function that will be executed
at runtime as I know this is not possible to determine in most
situations.
Thanks for any help in advance,
Brendon.
-
Brendon Costa wrote:
> Hi all,
>
> How can I find a FUNCTION_DECL node from a CALL_EXPR node for virtual
> function calls?
>
Well I have managed to achieve this, though I don't know if it is the
best way to do so. For the sake of people that may find this question in
the
Hi all,
I am having trouble with finding what method of a class that __comp_ctor
() would call. I have been assuming that it will call the constructor
method that has the same parameter list as the __comp_ctor () function
but this does not seem to be working.
Particulary when compiling code
Brendon Costa wrote:
basic_ofstream::basic_ofstream(int __in_chrg, void* __vtt_parm)
Can someone please help me understand why this happens?
Well looking more in the source I have found that this happens when
virtual inheritance is in play. It is used to determine which
constructor will
Hi again,
I am having issues with the __comp_ctor () __base_ctor () etc functions
that I encounter in the C++ front-end tree (Just before gimplification).
If i compile some code that looks like:
#include
int main()
{
std::allocator alloc;
const char* str1 = "Hello";
const char* str2 =
Sorry that my previous email was unclear. I have tried to clarify what i
meant in this email by answering your questions.
Andrew Pinski wrote:
On Tue, 2006-10-24 at 02:30 +, Brendon Costa wrote:
I am trying to find the corresponding constructor from the basic_string
class that should
Andrew Pinski wrote:
Why do you need to find (2)? It is not the function which is actually
called. DECL_SAVED_TREE might not be set but that is because it has
already been gimplified and lowered to CFG at the time you are looking
through the calls.
Why do you need to know the constructor anyw
In order to help, I am posting the code I use to try and get a "user
constructor" FUNCTION_DECL node from a "__comp_ctor ()" FUNCTION_DECL
node as mentioned in previous emails. The code can be found at the end
of this email.
Also...
class MyClass
{
MyClass()
{}
};
int main()
{
MyCl
For the code shown below, if i get the type node for the class:
"MyClassT" and then call TYPE_METHODS() on it and iterate over the
nodes, there is no FUNCTION_DECL node for the function:
MyClassT::MyClassT<::int, ::char const*>(::char const*)
From what I understand from the documentation, sinc
I have been looking at the source in
class.c:
clone_function_decl()
clone_constructors_and_destructors()
pt.c:
check_explicit_specialization()
In pt.c: check_explicit_specialization() it specifically requests that
the clone function of a specialised constructor NOT add the new clone t
Hi all,
Well after trying numerous different approaches to find the
FUNCTION_DECL node for a constructor like MyClass::MyClass(int) from a
FUNCTION_DECL node for one of the constructors: MyClass::__comp_ctor
(int) or similar, I have found that there is a VERY simple way to do
this using DECL_
In what situations is it valid to call DECL_TEMPLATE_INFO() on a
TYPE_DECL node?
I am using DECL_TEMPLATE_INFO in order to see if a DECL node has any
template information associated with it. The documentation says:
For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL
template-specific inform
Hi all,
Is this a bug in GCC or does the code below incorrectly use exceptions
and virtual inheritance?
I expect the code below to display:
Constructing child2.
Caught exception: 3
However it causes an abort after displaying the first line. Looking
further into this i found that when GCC creat
How can I get a full list of all GCC C++ built-in functions that may be
used on a given platform or GCC build?
For example, __cxa_begin_catch(), __cxa_end_catch(), __builtin_memset ...
I am currently working with GCC 4.0.1 source base.
Thanks,
Brendon.
Thanks for the information. It was very helpful.
I have now written some code (Seperate to gcc) that makes use of the
builtins.def and associated def files to generate a list of all builtin
functions as i require with the full prototypes as would be declared in
say a header file. Are there als
How do i determine if two type nodes in the C front end are equivilent?
In C++ i use same_type_p() but do not see an equivilant for the C front end.
Thanks,
Brendon.
The function you want is comptypes.
Thanks. That is working well.
Hi Brendon,
Wouldn't the C++ one (mostly) be a superset of the C?
Types are reasonably different between the C and C++ front ends though you do
have the common ones because as you said, C++ is a superset of C. The C++
I am having some trouble with getting type names as declared by the user
in source. In particular if i have two functions:
void Function(int i);
void Function(char c);
when processing the parameters i get an INTEGER_TYPE node in the
parameter list for both function as expected, however
IDENTI
> > I am having some trouble with getting type names as declared by the user
> > in source. In particular if i have two functions:
> >
> > void Function(int i);
> > void Function(char c);
> >
> > when processing the parameters i get an INTEGER_TYPE node in the
> > parameter list for both function a
Hi All,
I think i am having trouble with the garbage collector deleting the
memory for tree nodes that i am still using.
In my code i gather all sorts of information from FUNCTION_DECL
nodes as they pass through the gimplify_function_tree() function. I
gather info about types and funct
> The wiki page
>http://gcc.gnu.org/wiki/Memory_management
> might help you
>
> I had a quick glance at your mail, so I may be wrong, but I am not sure that
> you configured correctly the build system so that thet GTY(()) macros get
> processed correctly. Sadly, the gengtype generator does no
Mike Stump wrote:
On Nov 12, 2006, at 10:47 PM, Brendon Costa wrote:
I think i am having trouble with the garbage collector deleting
the memory for tree nodes that i am still using.
You must have a reference to that data from gc managed memory. If
you don't use use gc to all
Mike Stump wrote:
It is the difference between all features of gcc working, or just
most of the features working. If you want pch to work, you have to
think about the issue and do up the appropriate code. However, I bet
you don't need pch to work. If you are doing real stuff for a real
Hi all,
I am trying to obtain location information (file, line) for a number of
expr nodes (CALL_EXPR, THROW_EXPR and ADDR_EXPR) and it seems that every
expression node i call EXPR_HAS_LOCATION on returns false.
If it returns true i then use: EXPR_LINENO(), EXPR_FILENAME() to obtain
the requ
Steven Bosscher wrote:
On 11/17/06, Brendon Costa <[EMAIL PROTECTED]> wrote:
Is there something i should be doing before using EXPR_HAS_LOCATION() ?
Compile with -g, perhaps?
I tried that and it didnt seem to make any difference.
Brendon Costa wrote:
Hi all,
I am trying to obtain location information (file, line) for a number
of expr nodes (CALL_EXPR, THROW_EXPR and ADDR_EXPR) and it seems that
every expression node i call EXPR_HAS_LOCATION on returns false.
If it returns true i then use: EXPR_LINENO
Hi all,
I have just come across a small difference in the way the C an C++ front
ends handle anonymous struct types which is causing me some grief. In
particular the following code:
typedef struct
{
int b1;
int b2;
} Blah;
void Function(Blah* b) {}
When i get the Blah type in the func
Gabriel Dos Reis wrote:
> C++ defines a notion of "class name for linkage purpose" -- that is a
> notion used to define the One Definition Rule.
> In general the TYPE_NAME of TYPE_MAIN_VARIANT is the class name for
> linkage purpose.
> The behaviour you reported on implements the rule 7.1.3/5:
>
Andrew Pinski wrote:
> Again C has different rules from C++.
> In C, the following two TUs combined together are still valid code while in
> C++,
> they are invalid.
>
> tu1.c:
>
> struct a
> {
> int t;
> };
> void f(struct a);
>
> cut -
> tu2.c:
>
> type
Hi again,
Getting further along with my project, I have come across yet another
thing that I dont understand. While compiling:
libstdc++-v3/libsupc++/vec.cc
My GCC extension comes across two FUNCTION_DECL nodes that both have
DECL_ASSEMBLER_NAME of __cxa_begin_catch
After reading some past
Andrew Pinski wrote:
On Thu, 2006-11-30 at 16:08 +1100, Brendon Costa wrote:
Hi again,
Is it safe to assume in the C++ front end that two functions declared in
such a manner will always share the same implementation in which case it
is kind-of like a "using" statement?
I am getting a bit closer to finishing an alpha release of my project
which makes use of a modified version of GCC 4.0.1 in order to collect
data about the source code being compiled. In developing it i have come
across a number of things that I think may be helpful to be added to the
GCC Inter
Hi all,
I understand that all template functions in GCC should have vague
linkage and thus may be exported into numerous translation units where
they are used. I have been attempting to use a few different macros on
both an instanciated template functions FUNCTION_DECL node and a normal
functions
Brendon Costa wrote:
> Hi all,
>
> I understand that all template functions in GCC should have vague
> linkage and thus may be exported into numerous translation units where
> they are used. I have been attempting to use a few different macros on
> both an instanciated
Hi All,
I am trying to understand certain EXPR nodes, when they are generated
and how code generated from them behaves in the resulting program.
The nodes that have me a little confused are:
TRY_CATCH_EXPR
TRY_FINALLY_EXPR
MUST_NOT_THROW_EXPR
EH_FILTER_EXPR
Note: I have read the GCC Internals d
Thanks for the reply. One thing that I didnt quite get...
Ian Lance Taylor wrote:
TRY_CATCH_EXPR/TRY_FINALLY_EXPR
If operand 0 throws an exception, there is an implicit rethrow after
executing operand 1. (Of course, operand 1 can prevent that rethrow
by doing its own throw, or by callin
Hi All,
I am coding an extension for GCC and am having some difficulty with
pre-compiled headers. I dont know if my understanding of how they work
is completely correct and so my code is getting a segfault.
I have a hook into gimplify_function_tree() and I process functions as
they pass through t
that the way i
was going about it was going to fail.
Mike Stump wrote:
> On Feb 11, 2007, at 1:17 PM, Brendon Costa wrote:
>> I am coding an extension for GCC and am having some difficulty with
>> pre-compiled headers. I dont know if my understanding of how they work
>> is comp
Thanks for the response.
>> * Is it possible to explicitly free garbage collected memory if i know i
>> will not be needing it any more
>
> Yes, ggc_free.[1]
>
> 1 - Some people think that all the savings you'd get from this aren't
> work the pain of doing it, if you have to track down any over
Mike Stump wrote:
> On Feb 13, 2007, at 3:16 PM, Brendon Costa wrote:
>> There is no "additional" pain in doing this as I have already
>> developed my code using manual malloc/free in such a way that i am
>> reasonably sure there are no leaks, or double free calls
Hi All,
I am writing to find out if there is any method of obtaining or
constructing a function parameter list string as it would have been
defined in the source code?
For example for the function:
int Function(std::string v1, std::string v2) {return F(v1, v2);}
I would like to obtain a string t
I have for a while been working on a tool that performs static analysis
of exception propagation through C/C++ code. It is very close to
complete (I estimate the first release within the month).
Implementing static analysis of C++ exception propagation in g++ alone
is not really possible well at l
ly similar result. I might look into this at a later time.
Brendon.
Sergio Giro wrote:
> On Apr 2, 2007, at 2:32 AM, Brendon Costa wrote:
>> I have for a while been working on a tool that performs static
>> analysis
> I agree that Brendon's project is a very good ide
I prefer the method Jason mentioned of including this functionality as
a form of more strict checking of -Wexception-specs (Or maybe defining
a new warning) as opposed to having an attribute that defines new
semantics.
In the end the two are practically identical. The semantics of the
existing "OL
Aaron W. LaFramboise wrote:
> Jason Merrill wrote:
>> Sergio Giro wrote:
>>> I perceived that many people think that the throw qualifiers, as
>>> described by the standard, are not useful
>>
>> Yes. But that's not a reason to add a slightly different non-standard
>> feature that would require peop
Hi,
I am trying to make a small modification to a local copy of gcc (In
particular the g++ front end) that will help me in documenting
exceptions that can be thrown by functions. I have had a look at most of
the gcc documentation i could find and it has been helpful, but i am
currently stuck in
Hi all,
A while ago I attempted to make a modification to gcc 4.0 before it
was released. I attempted to create a modification that would allow me
to document all exceptions that are eithre thrown directly by a
function/method or that could propagate through a function/method. I ran
into a
I have notes inline below, following is my summary of libplugin from
what i understand of your posts:
* It exists as a fraemwork that works with GCC now
* It uses xml files to define plugins (Allows making new plugins as
combinations of others without making a new shared library, i.e. just
create a
> I believe we should first focus (when the runtime license will permit
> that) on making whatever plugin machinery available and merged into
> the trunk (when it comes back to stage one). This is not an easy task.
Isn't the point of this discussion to decide what features to put into a
plugin fra
> Personally I'm against the env var idea as it would make it harder to
> figure out what's going on. I think someone mentioned that the same
> effect could be achieved using spec files.
>
Ian mentioned the idea of creating small wrapper scripts with the names:
gcc/g++ etc which just call the re
> Sounds like you're almost in need of a generic data marshalling interface
> here.
>
Why do we need the complication of data marshaling?
I don't see why we need to define that all plugin hooks have the same
function interface as currently proposed. I.e. a single void*. This
makes a lot of w
Hi all,
I want to use GCC to categorise "functional purity" in C++. My
definition will differ from classic functional purity. In particular:
A function is considered pure if it makes no changes to existing
memory or program state. There may be a few exceptions to this rule
such as for new/malloc i
Forgot to reply all...
-- Forwarded message --
From: Brendon Costa <[EMAIL PROTECTED]>
Date: 2008/11/30
Subject: Re: Functional Purity
To: David Fang <[EMAIL PROTECTED]>
>Sounds like you want to (at least):
>
> 1) automatically qualify every d
2008/12/8 Simon Hill <[EMAIL PROTECTED]>:
> I'm curious as to why I didn't get any responses to my last posts here
> on 29 / 11 / 2008.
> http://gcc.gnu.org/ml/gcc/2008-11/
>
Hi Simon,
I have found in the past that larger posts do not get many if any
responses. One thing that might help is to ask
2009/2/1 Sean Callanan :
>
> (3) The -fplugin-arg argument is one way to do arguments. We do it as
>
> -ftree-plugin=/path/to/plugin.so:arg=value:arg=value:...
>
In the previous discussions we had on this whole thing
(http://gcc.gnu.org/ml/gcc/2008-09/msg00292.html), we were aiming
towards argum
t files to process for my
.edc files and how to combine them.
I am currently working with a gcc-4.0.1 source base. If someone can
point me as to where GCC links these files together I would greatly
appreciate it.
Thanks,
Brendon Costa.
Ian Lance Taylor wrote:
> Brendon Costa <[EMAIL PROTECTED]> writes:
>
>> Then GCC (SOMEWHERE I CANT SEEM TO FIND THIS PART OF THE CODE) links
>> these objects by calling ld with /tmp/foo1.o and /tmp/foo2.o combining
>> these into: blah
>
> It
Mike Stump wrote:
> Hum, on second thought, why not just encode the information you want
> into the .o file. Just put it into a special section, in whatever
> format you like, the linker will combine them, no additional files, .a
> files work, ld -r foo.o bar.o -o new.o works and so on. You can t
Brendon Costa wrote:
> Mike Stump wrote:
>> Hum, on second thought, why not just encode the information you want
>> into the .o file. Just put it into a special section, in whatever
>> format you like, the linker will combine them, no additional files, .a
>> files work,
Thanks for all the help. I have tried a few things now and decided to
try and create a new section called .edoc I tried using .comment on my
machine, however there is already data in .comment on my machine and
it will make parsing the data from the section to find my data a
little more difficult as
Hi all,
I have been trying to place some data into a named section of a .o
file. I can do it currently by hooking into various of the RTL to
assembly routines and emitting the asm code directly, however I am now
trying to do it from within the C++ front end by inserting a VAR_DECL
node and setting
Brendon Costa wrote:
> Hi all,
>
> I have been trying to place some data into a named section of a .o
> file. I can do it currently by hooking into various of the RTL to
> assembly routines and emitting the asm code directly, however I am now
> trying to do it from within th
Hi all,
I have been away from the GCC mailing list for a while. I searched the
archives but could not find a resolution to the issue of inclusion of
plugins to GCC.
Has it been decided if the GCC plugin branch will be added to GCC or not?
I am not after a discussion on the merits/issues of d
Can we count on the fact that the SVN branch will be synced from time to
time to the mainline ?
synchronized ...from... the mainline...
Yes.
When you say it will be synchronized from time to time, is it possible
to make it so that at least for each mainline GCC release we could
produce a
Andrew Pinski wrote:
On Jan 30, 2008 7:59 PM, H.J. Lu <[EMAIL PROTECTED]> wrote:
I am trying to get fndecl on a C++ CALL_EXPR with get_callee_fndecl.
But get_callee_fndecl returns NULL. What is the proper way to
get fndecl on a C++ CALL_EXPR in the middle end?
If it is returning NULL, then the
Hi all,
Every now and then I poke my head into this list to see if there is any
more progress on the GCC Plugin branch issue. In particular I don't want
to give up on this feature as it will be enormously useful for my open
source project EDoc++.
In the past, we have had a lot of discussion about
Hi all,
Firstly, do others think it would be helpful to summarise any of this
information on a wiki page, or will these emails be fine?
In this email I will give my opinion on the questions asked by Deigo and
ask a few additional questions that may be relevant.
--
Wha
Joseph S. Myers wrote:
> I think this is a bad idea on grounds of predictability.
I can understand this view and was initially reluctant to suggest the
auto-load feature for this same reason. However i can not see another
solution that can be used instead of this to achieve simple usability
for a
Ian Lance Taylor wrote:
> Write a one-line shell script to use as your compiler (that's what I
> would do), or define an environment variable which tells gcc which
> plugins to load (e.g., GCC_PLUGINS=/a/file:/another/file).
>
>
Thanks for the input.
The one-liner shell script is a very good op
Basile STARYNKEVITCH wrote:
> But what about the trunk, which uses tuples?
I know nothing about the tuples and the trunk and whether tuples might
affect the way plugins work. Maybe others can comment...
To be honest i was more worried about how plugins will work with the
garbage collector and pre-
> Sorry to nitpick, but there is nothing Mozilla-specific in
> dehydra/treehydra. There are users outside of Mozilla.
Sorry, i didn't realise this.
> However, I do think it's awesome to be able to store plugin results in
> the resulting binary to do LTO-style analyses. How well is that working
>
> I agree that it won't be very useful initially due to lots of third
> party code like boost neither defining nor adhering exception
> restrictions 100% of the time (STL may be guilty also). However, this
> is a catch 22. Why not provide the mechanism for verifying exception
> specifications so t
Simon Hill wrote:
> Brendon Costa said:
>> The author of the template class or container can't know
>> what types of exceptions will be thrown from them, so you must define
>> them as being able to throw all exceptions (which is how they are
>> currently).
> O
> The above works on code::blocks, which uses some form of GCC, and
> looks OK to me.
> Of course this only works for exactly one exception type.
> You'd have to wait for C++0X variadic templates (and hope you can
> throw them) if you need zero or more than one.
> It's also very verbose, a little
Hi all,
I have a project that could benefit a lot from using something similar
to GEM (http://www.ecsl.cs.sunysb.edu/gem/). I have not used GEM (As
doing so is pointless currently and thus my email), but to summarise for
others not familiar with it following is an except from their website:
GEM i
Ben Elliston wrote:
> I'm not sure how GEM (another Stony Book University project) relates to
> the talk given at this year's GCC Summit, but there was a talk about a
> plug-in architecture for GCC to allow modules to operate on the GIMPLE
> IR ("Extending GCC with Modular GIMPLE Optimisations" by
Hi all,
I have just recently had time to checkout and build the GCC plugin
branch. I am interested in building a simple plugin to give it a try.
After reading through the patches it seems simple enough, I just need to
create a shared library that defines the symbols:
pre_translation_unit
transfor
Ben Elliston wrote:
>> Does anyone have a template/example autoconf project that is already
>> setup with the needed gcc headers + build infrastructure to create a GCC
>> plugin?
>
> The talk at the GCC Summit mentioned a handful of existing plug-ins and
> Sean spoke about them all being autoconfi
>> The concern is the many forms of shim layers that possibly could
>> be written more easily with a plug-in framework.
>
> there is also a difference in these two scenarios:
>
> 1. a) Company X writes a modification to GCC to generate special
> intermediate stuff with format Y.
>
> b) Com
Robert Dewar wrote:
> Brendon Costa wrote:
>>>> The concern is the many forms of shim layers that possibly could
>>>> be written more easily with a plug-in framework.
>>> there is also a difference in these two scenarios:
>>>
>>> 1. a) Comp
Robert Dewar wrote:
> Brendon Costa wrote:
>
>> The patch against GCC is GPL, the main library that is capable of
>> manipulating the data exported by the patched GCC is LGPL and could
>> theoretically be under any license.
>
> Whose theory? You don't know tha
David Edelsohn wrote:
> If you want to have a legal discussion, please take this
> conversation somewhere else.
>
> Thanks, David
>
Sorry. I just posted another email before i got this. Is there a
suitable place to move this discussion besides private emails?
Thanks,
Brendon.
Joe Buck wrote:
> On Wed, Nov 07, 2007 at 09:20:21AM +0100, Emmanuel Fleury wrote:
>> Is there any progress in the gcc-plugin project ?
>
> Non-technical holdups. RMS is worried that this will make it too easy
> to integrate proprietary code directly with GCC.
>
> If proponents can come up with
Tom Tromey wrote:
> Bernd> In my view, plugins will bitrot quickly as GCC's interface
> Bernd> changes; and they won't even help with the learning curve -
> Bernd> does anyone believe for a second you won't have to understand
> Bernd> compiler internals to write a plugin?
>
> Plugins are about dep
94 matches
Mail list logo