CallInst* callInst = ...; // create a CallInst object AttrBuilder attrBuilder; attrBuilder.addAttribute(Attribute::NoReturn); callInst->setAttributes(attrBuilder);
CallInst* callInst = ...; // create a CallInst object AttrBuilder attrBuilder; attrBuilder.addAttribute(Attribute::NoUnwind); attrBuilder.addAttribute(Attribute::ReadOnly); attrBuilder.addAttribute(Attribute::ArgMemOnly); callInst->setAttributes(attrBuilder);This example sets several attributes on a CallInst object. The NoUnwind attribute indicates that the function called does not unwind the stack, while the ReadOnly attribute indicates that the function does not modify any memory. The ArgMemOnly attribute indicates that the function only accesses memory through its arguments. Package/library: LLVM