I want to create a custom attribute that marks a function in case if certain condition is met. As a first step I included below code in Attr.td file
def myattribute : InheritableAttr {
let Spellings = [GCC<"myattribute">];
let Subjects = SubjectList<[Function]>;
let SimpleHandler = 1;
let Documentation = [Undocumented];
}
as well as this code in SemaDeclAttr.cpp file
case ParsedAttr::AT_myattribute:
handleSimpleAttribute<myattributeAttr>(S, D, AL);
break;
but when i try to use this in the pass it gives me following error
error: ‘myattribute’ is not a member of ‘llvm::Attribute’
i am new to llvm could anyone tell me whats happening???
It might be because of the spelling, have you tried using
AT_Myattributeinstead ofAT_myattribute?