From 901b1a75c93ca8b92977c246d3c9db567e83147f Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 16 May 2008 20:39:43 +0000 Subject: Add functions to enable adding a single attribute to a function and its associated call site. llvm-svn: 51204 --- llvm/lib/VMCore/Instructions.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'llvm/lib/VMCore/Instructions.cpp') diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index ff3b8b546f0..40eea138350 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -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) -- cgit v1.2.3