diff options
author | Xinliang David Li <davidxl@google.com> | 2016-09-20 19:07:22 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-09-20 19:07:22 +0000 |
commit | a754c47ac53daa576a0c0899af1f2ef202d08cad (patch) | |
tree | 9b52fa773fe379090a1d14bf16ba3a0707e11893 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | 9b5d89513bf4eca8665d4adc37e89f77e27c75c8 (diff) | |
download | bcm5719-llvm-a754c47ac53daa576a0c0899af1f2ef202d08cad.tar.gz bcm5719-llvm-a754c47ac53daa576a0c0899af1f2ef202d08cad.zip |
[Profile] code refactoring: make getStep a method in base class
llvm-svn: 282002
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 3f747117b72..240250662ae 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -25,6 +25,7 @@ #include "llvm/IR/Constants.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Metadata.h" +#include "llvm/IR/Module.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -83,3 +84,12 @@ int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable, return LastLow - NameTable.begin(); return -1; } + +Value *InstrProfIncrementInst::getStep() const { + if (InstrProfIncrementInstStep::classof(this)) { + return const_cast<Value *>(getArgOperand(4)); + } + const Module *M = getModule(); + LLVMContext &Context = M->getContext(); + return ConstantInt::get(Type::getInt64Ty(Context), 1); +} |