diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
commit | 4ec2258ffb495d7ce00177e447740ef1123a27db (patch) | |
tree | 491894533b2bbca44875d321e209e1dc2e27abb3 /include/llvm/Support/CallSite.h | |
parent | 52d55bd224ac08dfef959527ca8257f82a80dbb0 (diff) | |
download | external_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.zip external_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.gz external_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.bz2 |
reapply r101434
with a fix for self-hosting
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@101465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/CallSite.h')
-rw-r--r-- | include/llvm/Support/CallSite.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 0650b61..7667ba0 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -255,27 +255,21 @@ public: private: /// Returns the operand number of the first argument unsigned getArgumentOffset() const { - if (isCall()) - return 1; // Skip Function (ATM) - else return 0; // Args are at the front } unsigned getArgumentEndOffset() const { if (isCall()) - return 0; // Unchanged (ATM) + return 1; // Skip Function else return 3; // Skip BB, BB, Function } IterTy getCallee() const { - // FIXME: this is slow, since we do not have the fast versions - // of the op_*() functions here. See CallSite::getCallee. - // - if (isCall()) - return getInstruction()->op_begin(); // Unchanged (ATM) - else - return getInstruction()->op_end() - 3; // Skip BB, BB, Function + // FIXME: this is slow, since we do not have the fast versions + // of the op_*() functions here. See CallSite::getCallee. + // + return arg_end(); } }; |