[cfe-dev] passing clang attribute to llvm

Rajarshi Mukherjee via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 12 16:51:11 PDT 2017


Hi
I am trying to declare custom attribute in clang on local variables and pass it to llvm IR
I am able to add the attribute in Attr.td and SemaDeclAttr.cpp. In CGDecl.cpp - I can add the attribute to llvm *value as long it as the variable in C is static or global (EmitStaticVarDecl)
AddAttr API exists in llvm global variable but not on instruction. 
Is there a way to attach attribute to llvm local variables which I assume would go to allocaInst. Is there any other way?
Thanks
Rajarshi 

  



More information about the cfe-dev mailing list