summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2008-05-16 20:39:43 +0000
committerEric Christopher <echristo@apple.com>2008-05-16 20:39:43 +0000
commit901b1a75c93ca8b92977c246d3c9db567e83147f (patch)
treebad9a663759928c698caae9386e22243c28d7bd3 /llvm/lib
parentd5a4838e3da5355573d30115f12dda562be37232 (diff)
downloadbcm5719-llvm-901b1a75c93ca8b92977c246d3c9db567e83147f.tar.gz
bcm5719-llvm-901b1a75c93ca8b92977c246d3c9db567e83147f.zip
Add functions to enable adding a single attribute to a function and
its associated call site. llvm-svn: 51204
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Function.cpp6
-rw-r--r--llvm/lib/VMCore/Instructions.cpp12
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 9f7eefe1a6b..49e69e1b2c1 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -240,6 +240,12 @@ void Function::setDoesNotThrow(bool doesNotThrow) {
setParamAttrs(PAL);
}
+void Function::addParamAttr(unsigned i, ParameterAttributes attr) {
+ PAListPtr PAL = getParamAttrs();
+ PAL = PAL.addAttr(i, attr);
+ setParamAttrs(PAL);
+}
+
// Maintain the collector name for each function in an on-the-side table. This
// saves allocating an additional word in Function for programs which do not use
// GC (i.e., most programs) at the cost of increased overhead for clients which
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)
OpenPOWER on IntegriCloud