[cfe-dev] atomic builtins

Douglas Gregor dgregor at apple.com
Tue May 5 22:12:13 PDT 2009


On May 5, 2009, at 10:45 PM, Douglas Gregor wrote:
> On May 5, 2009, at 12:42 PM, Chris Lattner wrote:
> ow we'd model that with overloading. :(
>
>> If we could get this resolved into a different builtin id for every
>> width, the code generator could do the right thing.
>>
>> 2. Add all the versions (with the name suffixes) to the builtins.td
>> file and have sema change the AST (introducing casts and a new  
>> callee)
>> when it analyzes the call.
>>
>> 3. Add just the overloaded version of the builtin to the builtins.def
>> file, and make sema change it into a new AtomicExpr node.  This would
>> be better than #2 for representing the source level construct.
>>
>> Does anyone have an opinion on this?  I'm not exactly sure what is
>> required to get #1 working.  If that can't work, I tend to think that
>> #3 is best.
>
> #2 seems like the best solution here.

So, I really meant #3, because we can most easily deal with the  
variations in the different atomic operations if it's a special AST  
type like AtomicExpr.

	- Doug



More information about the cfe-dev mailing list