Add functions to enable adding a single attribute to a function and

its associated call site.

llvm-svn: 51204
This commit is contained in:
Eric Christopher
2008-05-16 20:39:43 +00:00
parent d5a4838e3d
commit 901b1a75c9
4 changed files with 27 additions and 0 deletions

View File

@@ -373,6 +373,12 @@ CallInst::CallInst(const CallInst &CI)
OL[i].init(InOL[i], this);
}
void CallInst::addParamAttr(unsigned i, ParameterAttributes attr) {
PAListPtr PAL = getParamAttrs();
PAL = PAL.addAttr(i, attr);
setParamAttrs(PAL);
}
bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
if (ParamAttrs.paramHasAttr(i, attr))
return true;
@@ -449,6 +455,12 @@ bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
return false;
}
void InvokeInst::addParamAttr(unsigned i, ParameterAttributes attr) {
PAListPtr PAL = getParamAttrs();
PAL = PAL.addAttr(i, attr);
setParamAttrs(PAL);
}
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
PAListPtr PAL = getParamAttrs();
if (doesNotThrow)