bool paramHasNestAttr(unsigned i) const;
bool paramHasByValAttr(unsigned i) const;
bool paramHasNoAliasAttr(unsigned i) const;
+ bool paramHasNoCaptureAttr(unsigned i) const;
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, Attributes attr) const;
bool paramHasNestAttr(unsigned i) const;
bool paramHasByValAttr(unsigned i) const;
bool paramHasNoAliasAttr(unsigned i) const;
+ bool paramHasNoCaptureAttr(unsigned i) const;
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, Attributes attr) const;
bool paramHasNoAliasAttr(unsigned i) const {
CALLSITE_DELEGATE_GETTER(paramHasNoAliasAttr(i));
}
+ bool paramHasNoCaptureAttr(unsigned i) const {
+ CALLSITE_DELEGATE_GETTER(paramHasNoCaptureAttr(i));
+ }
/// paramHasAttr - whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, Attributes attr) const {
/// @brief Determine whether this argument is not captured.
bool doesNotCapture(unsigned ArgNo) const {
- return paramHasAttr(ArgNo + 1, Attribute::NoCapture);
+ return paramHasNoCaptureAttr(ArgNo + 1);
}
/// @brief Determine whether this argument is passed by value.
bool isByValArgument(unsigned ArgNo) const {
- return paramHasAttr(ArgNo + 1, Attribute::ByVal);
+ return paramHasByValAttr(ArgNo + 1);
}
/// hasArgument - Returns true if this CallSite passes the given Value* as an
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;
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;