[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] How to change calling convention.
From:       Eli Friedman <eli.friedman () gmail ! com>
Date:       2011-07-27 16:47:19
Message-ID: CAJdarcEWjhWAXGXjhSGk=AX_VgXrrx02ZjO7k6R8_8exFRHhfg () mail ! gmail ! com
[Download RAW message or body]

On Wed, Jul 27, 2011 at 9:09 AM, Anderson, Todd A
<todd.a.anderson@intel.com> wrote:
> I tried creating a copy of the type using the copy constructor of FunctionType but \
> that just gave me a bunch of compile errors about the Type constructor being \
> private.

There are methods to build new types on ASTContext.

> Then I wanted to change the calling convention of that copied type and call \
> setType.  I'm currently trying to construct a new FunctionType using get methods on \
> the previous type to fill in the parts that remain constant.  The problem at the \
> moment is that isVariadic() seems to be private but I presume that function types \
> cannot be Variadic so I'll just pass false there and then try setType.

There are two kinds of FunctionType: FunctionProtoType and
FunctionNoProtoType.  They need to be handled slightly differently.

> What I'm trying to do is add pragmas that control the default calling convention.  \
> If there is a way to do this all within the Lexer rather than changing it \
> afterwards I'm all ears.

There are some existing pragmas that are a bit similar; look in
lib/Parse/ParsePragma.cpp.

-Eli

_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic