Displaying 5 results from an estimated 5 matches for "getattributespellinglistindex".
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
...IR
> attributes to be passed along to LLVM.
>
> HTH!
>
> ~Aaron
Hi,
Thx for your answer...
I tried that without any luck:
static void handleOBF(Sema &S, Decl *D, const AttributeList &Attr) {
D->addAttr(::new (S.Context)NoFLAAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex()));
// ???????????
llvm::AttrBuilder FuncAttrs;
FuncAttrs.addAttribute();
}
In CodeGenModule::ConstructAttributeList it uses a AttrBuilder, I tried there to add a random attribute and it works.
But I’m not understanding how to do that in SemaDeclAttr.cpp.
Cheers
2016 Nov 25
2
Translation of custom attribute (defined for variables) from clang to llvm
...= 5;
volatile unsigned int *p;
p = &a;
return (a+*p);
}
and actually when I Dump the declaration, after adding the attribute in
handleMoviAttr() function in SemaDeclAttr.cpp as shown in following
snippet
D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context,
Val, Attr.getAttributeSpellingListIndex()));
D->dump();
It is dumped by clang with following output
VarDecl 0x440c698 <file.c:6:17, line:10:32> col:32 a 'volatile unsigned
int'
`-moviAttrAttr 0x440c6d0 <line:6:32, col:42> 1
HOWEVER, the attribute doesnt appear in IR of the program. IR is shown
below.
*** IR D...
2016 Nov 25
3
Translation of custom attribute (defined for variables) from clang to llvm
...t; }
>>
>> and actually when I Dump the declaration, after adding the attribute
>> in handleMoviAttr() function in SemaDeclAttr.cpp as shown in
>> following snippet
>>
>> D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context,
>> Val, Attr.getAttributeSpellingListIndex()));
>> D->dump();
>>
>> It is dumped by clang with following output
>>
>> VarDecl 0x440c698 <file.c:6:17, line:10:32> col:32 a 'volatile
>> unsigned int'
>> `-moviAttrAttr 0x440c6d0 <line:6:32, col:42> 1
>>
>> HOWEVER,...
2016 Nov 28
2
Translation of custom attribute (defined for variables) from clang to llvm
...Dump the declaration, after adding the attribute
>> >> in handleMoviAttr() function in SemaDeclAttr.cpp as shown in
>> >> following snippet
>> >>
>> >> D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context,
>> >> Val, Attr.getAttributeSpellingListIndex()));
>> >> D->dump();
>> >>
>> >> It is dumped by clang with following output
>> >>
>> >> VarDecl 0x440c698 <file.c:6:17, line:10:32> col:32 a 'volatile
>> >> unsigned int'
>> >> `-moviAttrAttr 0x44...
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
Hi,
I want to *tag* some functions with some *flags*. I was using annotate((“myFlag”)) and everything was working fine until I tried on ObjC method. It seems that clang just ignore it.
So, to be able to *flag* my functions I’m trying to add a *real* attribute to clang.
I’ve added a new attribute to clang in tools/clang/include/clang/Basic/Attr.td:
def NoFLA : Attr {
let Spellings =