[LLVMdev] attributes

Dmitri Gribenko gribozavr at gmail.com
Wed Jan 9 17:00:59 PST 2013


On Thu, Jan 10, 2013 at 2:50 AM, reed kotler <rkotler at mips.com> wrote:
> On 01/09/2013 02:44 PM, Eli Friedman wrote:
>>
>> On Wed, Jan 9, 2013 at 2:19 PM, reed kotler <rkotler at mips.com> wrote:
>>>
>>> On 01/09/2013 01:19 PM, Sean Silva wrote:
>>>>
>>>> On Wed, Jan 9, 2013 at 4:14 PM, reed kotler <rkotler at mips.com> wrote:
>>>>>
>>>>> Does anyone know offhand where this gets added to clang and where the
>>>>> hook
>>>>> for processing
>>>>> in llc is?
>>>>>
>>>>> I think that this code has changed recently.
>>>>
>>>> There's
>>>>
>>>> <http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-attribute>.
>>>> If that's not up to date please let me know.
>>>>
>>>> -- Sean Silva
>>>
>>> Thanks.
>>>
>>> Not sure I understand the purpose of InheritableAttr .
>>
>> InheritableAttr is related to our behavior for testcases like the
>> following:
>>
>> __attribute((fastcall)) int f(void);
>> int f(void);
>>
>> (More generally, it looks like your attributes are very similar to the
>> fastcall attribute; just do what we do for the fastcall attribute, and
>> it'll be roughly correct.)
>>
>> -Eli
>
> Cool.
>
> What about   let Subjects = [Function]; ???
> is this what we want??
>
> That's not on things like fastcall or naked ..

Please do add Subjects = [Function], but it will not affect anything
-- this is just for documentation purposes now.  You have to do the
relevant checks yourself in semantic analysis for the attribute (in
HandleZZZ function).

(Maybe in future, when someone has time to rewrite attribute semantic
analysis, these checks can be generated automatically.)

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-dev mailing list