aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-06 15:44:11 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-06 15:44:11 +0000
commite9e1215d94d3afa12f5d49c415a80bd4721c97ab (patch)
treecc995c491b27a8d4a1dfa8dca30c83ebab97d1bc
parentaa8c19405ac3891ee7fbea1a509c6774ca7a5b59 (diff)
second round of low-level interface squeeze-out:
making all of CallInst's low-level operand accessors private If you get compile errors I strongly urge you to update your code. I tried to write the necessary clues into the header where the compiler may point to, but no guarantees. It works for my GCC. You have several options to update your code: - you can use the v2.8 ArgOperand accessors - you can go via a temporary CallSite - you can upcast to, say, User and call its low-level accessors if your code is definitely operand-order agnostic. If you run into serious problems, please comment in below thread (and back out this revision only if absolutely necessary): <http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107667 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Instructions.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 4dd1516e38..7129b6e14e 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -940,8 +940,25 @@ public:
unsigned(isTC));
}
+ /// @deprecated these "define hacks" will go away soon
+ /// @brief coerce out-of-tree code to abandon the low-level interfaces
+ /// @detail see below comments and update your code to high-level interfaces
+ /// in LLVM v2.8-only code
+ /// - getOperand(N+1) ---> getArgOperand(N)
+ /// - setOperand(N+1, V) ---> setArgOperand(N, V)
+ /// - getNumOperands() ---> getNumArgOperands()+1 // note the "+1"!
+ ///
+ /// in backward compatible code please consult llvm/Support/CallSite.h,
+ /// you should create a callsite using the CallInst pointer and call its
+ /// methods
+ ///
+# define public private
+# define protected private
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+# undef public
+# undef protected
+public:
enum { ArgOffset = 1 }; ///< temporary, do not use for new code!
unsigned getNumArgOperands() const { return getNumOperands() - 1; }
@@ -951,11 +968,12 @@ public:
/// Provide compile-time errors for accessing operand 0
/// @deprecated these will go away soon
/// @detail see below comments and update your code to high-level interfaces
- /// - getOperand(0) ---> getCalledValue()
+ /// - getOperand(0) ---> getCalledValue(), or possibly getCalledFunction
/// - setOperand(0, V) ---> setCalledFunction(V)
///
private:
- void getOperand(void*); // NO IMPL ---> use getCalledValue (or possibly getCalledFunction) instead
+ void getOperand(void*); // NO IMPL ---> use getCalledValue (or possibly
+ // getCalledFunction) instead
void setOperand(void*, Value*); // NO IMPL ---> use setCalledFunction instead
public:
@@ -1103,6 +1121,10 @@ CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
typename std::iterator_traits<InputIterator>::iterator_category());
}
+
+// Note: if you get compile errors about private methods then
+// please update your code to use the high-level operand
+// interfaces. See line 943 above.
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CallInst, Value)
//===----------------------------------------------------------------------===//