X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FIntrinsicInst.h;h=169bcc021984f57cba154f85f67a633f202397d7;hb=a5be9e3cfba9cc841f37881a60bf5337aac5a704;hp=bf0adc3934776beba3278f604e701d23dbbbbf1d;hpb=40510a07cf8b104a395fc469df3d39ee1a5c840f;p=oota-llvm.git diff --git a/include/llvm/IR/IntrinsicInst.h b/include/llvm/IR/IntrinsicInst.h index bf0adc39347..169bcc02198 100644 --- a/include/llvm/IR/IntrinsicInst.h +++ b/include/llvm/IR/IntrinsicInst.h @@ -42,7 +42,7 @@ namespace llvm { /// getIntrinsicID - Return the intrinsic ID of this intrinsic. /// Intrinsic::ID getIntrinsicID() const { - return (Intrinsic::ID)getCalledFunction()->getIntrinsicID(); + return getCalledFunction()->getIntrinsicID(); } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -82,11 +82,11 @@ namespace llvm { class DbgDeclareInst : public DbgInfoIntrinsic { public: Value *getAddress() const; - MDLocalVariable *getVariable() const { - return cast(getRawVariable()); + DILocalVariable *getVariable() const { + return cast(getRawVariable()); } - MDExpression *getExpression() const { - return cast(getRawExpression()); + DIExpression *getExpression() const { + return cast(getRawExpression()); } Metadata *getRawVariable() const { @@ -115,11 +115,11 @@ namespace llvm { return cast( const_cast(getArgOperand(1)))->getZExtValue(); } - MDLocalVariable *getVariable() const { - return cast(getRawVariable()); + DILocalVariable *getVariable() const { + return cast(getRawVariable()); } - MDExpression *getExpression() const { - return cast(getRawExpression()); + DIExpression *getExpression() const { + return cast(getRawExpression()); } Metadata *getRawVariable() const { @@ -372,6 +372,39 @@ namespace llvm { return cast(const_cast(getArgOperand(3))); } }; -} + + /// This represents the llvm.instrprof_value_profile intrinsic. + class InstrProfValueProfileInst : public IntrinsicInst { + public: + static inline bool classof(const IntrinsicInst *I) { + return I->getIntrinsicID() == Intrinsic::instrprof_value_profile; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + + GlobalVariable *getName() const { + return cast( + const_cast(getArgOperand(0))->stripPointerCasts()); + } + + ConstantInt *getHash() const { + return cast(const_cast(getArgOperand(1))); + } + + Value *getTargetValue() const { + return cast(const_cast(getArgOperand(2))); + } + + ConstantInt *getValueKind() const { + return cast(const_cast(getArgOperand(3))); + } + + // Returns the value site index. + ConstantInt *getIndex() const { + return cast(const_cast(getArgOperand(4))); + } + }; +} // namespace llvm #endif