summaryrefslogtreecommitdiff
path: root/include/llvm/Support/CallSite.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-16 01:16:20 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-16 01:16:20 +0000
commit607a7ab3da72a2eb53553a520507cbb8068dd1d8 (patch)
treea24f057eee6bdd4edd74d509424b13bed1dda2de /include/llvm/Support/CallSite.h
parent5f0378251c4b682b51d194fce45da1587ed9c97b (diff)
downloadllvm-607a7ab3da72a2eb53553a520507cbb8068dd1d8.tar.gz
llvm-607a7ab3da72a2eb53553a520507cbb8068dd1d8.tar.bz2
llvm-607a7ab3da72a2eb53553a520507cbb8068dd1d8.tar.xz
back out r101423 and r101397, they break llvm-gcc self-host on darwin10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/CallSite.h')
-rw-r--r--include/llvm/Support/CallSite.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 7667ba03e3..0650b61fbc 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -255,21 +255,27 @@ 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 1; // Skip Function
+ return 0; // Unchanged (ATM)
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.
- //
- return arg_end();
+ // 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
}
};