[llvm-dev] Adding a function attribute with an argument

Gaël Jobin via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 13 07:18:33 PDT 2015


Hi Tehila,
Le mardi 13 octobre 2015 à 15:55 +0300, Tehila Mayzels a écrit :
> How did you manage to access the argument value at the IR stage?
Something like this if I remember correctly:
Function *f = ...;
int myargument;

if(f->hasFnAttribute("myexample"))
{
	if(f->hasFnAttribute("myargument"))
	{
		myargument = f->getFnAttribute("myargument").getValueAsInt();
	}
}

//...
Regards,
Gaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151013/321c6d37/attachment.html>


More information about the llvm-dev mailing list