summaryrefslogtreecommitdiff
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-15 10:49:53 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-15 10:49:53 +0000
commit165dac08d1bb8428b32a5f39cdd3dbee2888987f (patch)
treeb96c81333b16aa40af609dd54fa4ea51cfd1f743 /include/llvm/Instructions.h
parente6987587d62bb4de0f57e103f677f6bfb43a09f3 (diff)
downloadllvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.tar.gz
llvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.tar.bz2
llvm-165dac08d1bb8428b32a5f39cdd3dbee2888987f.tar.xz
rotate CallInst operands, i.e. move callee to the back
of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 413a595ab3..d6dd94d9e9 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -1031,17 +1031,17 @@ public:
/// indirect function invocation.
///
Function *getCalledFunction() const {
- return dyn_cast<Function>(Op<0>());
+ return dyn_cast<Function>(Op<-1>());
}
/// getCalledValue - Get a pointer to the function that is invoked by this
/// instruction.
- const Value *getCalledValue() const { return Op<0>(); }
- Value *getCalledValue() { return Op<0>(); }
+ const Value *getCalledValue() const { return Op<-1>(); }
+ Value *getCalledValue() { return Op<-1>(); }
/// setCalledFunction - Set the function called.
void setCalledFunction(Value* Fn) {
- Op<0>() = Fn;
+ Op<-1>() = Fn;
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -1071,7 +1071,7 @@ CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
->getElementType())->getReturnType(),
Instruction::Call,
OperandTraits<CallInst>::op_end(this) - (ArgEnd - ArgBegin + 1),
- (unsigned)(ArgEnd - ArgBegin + 1), InsertAtEnd) {
+ unsigned(ArgEnd - ArgBegin + 1), InsertAtEnd) {
init(Func, ArgBegin, ArgEnd, NameStr,
typename std::iterator_traits<InputIterator>::iterator_category());
}