mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 06:27:16 +00:00
Add some functionality to the IntrinsicInst class and some comments
llvm-svn: 25289
This commit is contained in:
parent
67a0c03bb4
commit
731f17c9bd
@ -30,6 +30,9 @@
|
|||||||
#include "llvm/Intrinsics.h"
|
#include "llvm/Intrinsics.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
/// IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic
|
||||||
|
/// functions. This allows the standard isa/dyncast/cast functionality to
|
||||||
|
/// work with calls to intrinsic functions.
|
||||||
class IntrinsicInst : public CallInst {
|
class IntrinsicInst : public CallInst {
|
||||||
IntrinsicInst(); // DO NOT IMPLEMENT
|
IntrinsicInst(); // DO NOT IMPLEMENT
|
||||||
IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT
|
IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT
|
||||||
@ -40,6 +43,23 @@ namespace llvm {
|
|||||||
/// casts from the specified value, returning the original uncasted value.
|
/// casts from the specified value, returning the original uncasted value.
|
||||||
/// Note that the returned value is guaranteed to have pointer type.
|
/// Note that the returned value is guaranteed to have pointer type.
|
||||||
static Value *StripPointerCasts(Value *Ptr);
|
static Value *StripPointerCasts(Value *Ptr);
|
||||||
|
|
||||||
|
/// getIntrinsicID - Return the intrinsic ID of this intrinsic.
|
||||||
|
///
|
||||||
|
Intrinsic::ID getIntrinsicID() const {
|
||||||
|
return (Intrinsic::ID)getCalledFunction()->getIntrinsicID();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
|
static inline bool classof(const IntrinsicInst *) { return true; }
|
||||||
|
static inline bool classof(const CallInst *I) {
|
||||||
|
if (const Function *CF = I->getCalledFunction())
|
||||||
|
return CF->getIntrinsicID() != 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
static inline bool classof(const Value *V) {
|
||||||
|
return isa<CallInst>(V) && classof(cast<CallInst>(V));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
|
/// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
|
||||||
|
Loading…
Reference in New Issue
Block a user