summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-04 07:18:12 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-04 07:18:12 +0000
commitdaf8e38ba87cc4defe6604f37f5af61719ed01a2 (patch)
tree0d9dea81fde3650da78f2d441d5ebff7917dbb57 /llvm/lib
parent5d637b7d5b02e351877eaf97fe3e780ff56e0d1d (diff)
downloadbcm5719-llvm-daf8e38ba87cc4defe6604f37f5af61719ed01a2.tar.gz
bcm5719-llvm-daf8e38ba87cc4defe6604f37f5af61719ed01a2.zip
Add method to query for NoCapture attribute.
llvm-svn: 165212
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 9b700451bee..e3cbf220d4a 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud