aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 9b700451be..e3cbf220d4 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -398,6 +398,14 @@ bool CallInst::paramHasNoAliasAttr(unsigned i) const {
return false;
}
+bool CallInst::paramHasNoCaptureAttr(unsigned i) const {
+ if (AttributeList.getParamAttributes(i).hasNoCaptureAttr())
+ return true;
+ if (const Function *F = getCalledFunction())
+ return F->getParamAttributes(i).hasNoCaptureAttr();
+ return false;
+}
+
bool CallInst::paramHasAttr(unsigned i, Attributes attr) const {
if (AttributeList.paramHasAttr(i, attr))
return true;
@@ -674,6 +682,14 @@ bool InvokeInst::paramHasNoAliasAttr(unsigned i) const {
return false;
}
+bool InvokeInst::paramHasNoCaptureAttr(unsigned i) const {
+ if (AttributeList.getParamAttributes(i).hasNoCaptureAttr())
+ return true;
+ if (const Function *F = getCalledFunction())
+ return F->getParamAttributes(i).hasNoCaptureAttr();
+ return false;
+}
+
bool InvokeInst::paramHasAttr(unsigned i, Attributes attr) const {
if (AttributeList.paramHasAttr(i, attr))
return true;