summaryrefslogtreecommitdiff
path: root/include/llvm/IR/CallSite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/CallSite.h')
-rw-r--r--include/llvm/IR/CallSite.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/include/llvm/IR/CallSite.h b/include/llvm/IR/CallSite.h
index 96fbebf42c38..5b10da8f2aee 100644
--- a/include/llvm/IR/CallSite.h
+++ b/include/llvm/IR/CallSite.h
@@ -35,7 +35,6 @@
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
@@ -46,6 +45,10 @@
namespace llvm {
+namespace Intrinsic {
+enum ID : unsigned;
+}
+
template <typename FunTy = const Function,
typename BBTy = const BasicBlock,
typename ValTy = const Value,
@@ -59,7 +62,7 @@ class CallSiteBase {
protected:
PointerIntPair<InstrTy*, 1, bool> I;
- CallSiteBase() : I(nullptr, false) {}
+ CallSiteBase() = default;
CallSiteBase(CallTy *CI) : I(CI, true) { assert(CI); }
CallSiteBase(InvokeTy *II) : I(II, false) { assert(II); }
explicit CallSiteBase(ValTy *II) { *this = get(II); }
@@ -107,12 +110,12 @@ public:
/// Return true if the callsite is an indirect call.
bool isIndirectCall() const {
- Value *V = getCalledValue();
+ const Value *V = getCalledValue();
if (!V)
return false;
if (isa<FunTy>(V) || isa<Constant>(V))
return false;
- if (CallInst *CI = dyn_cast<CallInst>(getInstruction())) {
+ if (const CallInst *CI = dyn_cast<CallInst>(getInstruction())) {
if (CI->isInlineAsm())
return false;
}
@@ -426,6 +429,11 @@ public:
CALLSITE_DELEGATE_GETTER(isNoBuiltin());
}
+ /// Return true if the call requires strict floating point semantics.
+ bool isStrictFP() const {
+ CALLSITE_DELEGATE_GETTER(isStrictFP());
+ }
+
/// Return true if the call should not be inlined.
bool isNoInline() const {
CALLSITE_DELEGATE_GETTER(isNoInline());
@@ -467,6 +475,24 @@ public:
CALLSITE_DELEGATE_SETTER(setOnlyAccessesArgMemory());
}
+ /// Determine if the function may only access memory that is
+ /// inaccessible from the IR.
+ bool onlyAccessesInaccessibleMemory() const {
+ CALLSITE_DELEGATE_GETTER(onlyAccessesInaccessibleMemory());
+ }
+ void setOnlyAccessesInaccessibleMemory() {
+ CALLSITE_DELEGATE_SETTER(setOnlyAccessesInaccessibleMemory());
+ }
+
+ /// Determine if the function may only access memory that is
+ /// either inaccessible from the IR or pointed to by its arguments.
+ bool onlyAccessesInaccessibleMemOrArgMem() const {
+ CALLSITE_DELEGATE_GETTER(onlyAccessesInaccessibleMemOrArgMem());
+ }
+ void setOnlyAccessesInaccessibleMemOrArgMem() {
+ CALLSITE_DELEGATE_SETTER(setOnlyAccessesInaccessibleMemOrArgMem());
+ }
+
/// Determine if the call cannot return.
bool doesNotReturn() const {
CALLSITE_DELEGATE_GETTER(doesNotReturn());
@@ -488,7 +514,7 @@ public:
CALLSITE_DELEGATE_GETTER(cannotDuplicate());
}
void setCannotDuplicate() {
- CALLSITE_DELEGATE_GETTER(setCannotDuplicate());
+ CALLSITE_DELEGATE_SETTER(setCannotDuplicate());
}
/// Determine if the call is convergent.