aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/CallSite.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-03-19 13:50:02 +0000
committerGabor Greif <ggreif@gmail.com>2010-03-19 13:50:02 +0000
commite02ef8a6fcc83c39068e2baf33c7f55e4a5c9c20 (patch)
treec6a5d3281d45adaa8a89ad366a54ae5d7c965ad4 /include/llvm/Support/CallSite.h
parentde6c04c8aba7acc53865d4e09a6fd9ed0bacd6c2 (diff)
downloadexternal_llvm-e02ef8a6fcc83c39068e2baf33c7f55e4a5c9c20.zip
external_llvm-e02ef8a6fcc83c39068e2baf33c7f55e4a5c9c20.tar.gz
external_llvm-e02ef8a6fcc83c39068e2baf33c7f55e4a5c9c20.tar.bz2
back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/CallSite.h')
-rw-r--r--include/llvm/Support/CallSite.h30
1 files changed, 6 insertions, 24 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 5bfcc6d..285b558 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -118,7 +118,7 @@ public:
///
Value *getCalledValue() const {
assert(getInstruction() && "Not a call or invoke instruction!");
- return *getCallee();
+ return getInstruction()->getOperand(0);
}
/// getCalledFunction - Return the function being called if this is a direct
@@ -132,7 +132,7 @@ public:
///
void setCalledFunction(Value *V) {
assert(getInstruction() && "Not a call or invoke instruction!");
- *getCallee() = V;
+ getInstruction()->setOperand(0, V);
}
Value *getArgument(unsigned ArgNo) const {
@@ -146,16 +146,6 @@ public:
getInstruction()->setOperand(getArgumentOffset() + ArgNo, newVal);
}
- /// Given a value use iterator, returns the argument that corresponds to it.
- /// Iterator must actually correspond to an argument.
- unsigned getArgumentNo(Value::use_iterator I) const {
- assert(getInstruction() && "Not a call or invoke instruction!");
- assert(arg_begin() <= &I.getUse() && &I.getUse() < arg_end()
- && "Argument # out of range!");
-
- return &I.getUse() - arg_begin();
- }
-
/// Given an operand number, returns the argument that corresponds to it.
/// OperandNo must be a valid operand number that actually corresponds to an
/// argument.
@@ -181,7 +171,7 @@ public:
return getInstruction()->op_begin() + getArgumentOffset();
}
- arg_iterator arg_end() const { return getInstruction()->op_end() - getArgumentEndOffset(); }
+ arg_iterator arg_end() const { return getInstruction()->op_end(); }
bool arg_empty() const { return arg_end() == arg_begin(); }
unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
@@ -190,25 +180,17 @@ public:
}
bool isCallee(Value::use_iterator UI) const {
- return getCallee() == &UI.getUse();
+ return getInstruction()->op_begin() == &UI.getUse();
}
+
private:
/// Returns the operand number of the first argument
unsigned getArgumentOffset() const {
if (isCall())
return 1; // Skip Function
else
- return 0; // Args are at the front
+ return 3; // Skip Function, BB, BB
}
-
- unsigned getArgumentEndOffset() const {
- if (isCall())
- return 0; // Unchanged
- else
- return 3; // Skip BB, BB, Function
- }
-
- User::op_iterator getCallee() const;
};
} // End llvm namespace