From: Gabor Greif Date: Thu, 1 Jul 2010 21:46:41 +0000 (+0000) Subject: evil hack to coerce external users (projects) X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=0f66d4be04787906fb3a40ff572bc8c16a41bb96 evil hack to coerce external users (projects) to update their code to high-level interfaces If you get compile errors in your project please update your code according to the comments. This is a re-commit of r107396 which causes compile errors for the indicated usage patterns instead of link errors (which are less easy to fix because of missing source location). If you get compile errors please perform following functionally equivalent transformations: - getOperand(0) ---> getCalledValue() - setOperand(0, V) ---> setCalledFunction(V) This will make your code more future-proof and avoid potentially hard-to-debug bugs. please refer to this thread on llvm-dev: git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107432 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 814329288d0..21cc2eac4e2 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -948,6 +948,17 @@ public: Value *getArgOperand(unsigned i) const { return getOperand(i + ArgOffset); } void setArgOperand(unsigned i, Value *v) { setOperand(i + ArgOffset, v); } + /// 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() + /// - setOperand(0, V) ---> setCalledFunction(V) + /// +private: + void getOperand(void*); // NO IMPL ---> use getCalledValue (or possibly getCalledFunction) instead + void setOperand(void*, Value*); // NO IMPL ---> use setCalledFunction instead +public: + /// getCallingConv/setCallingConv - Get or set the calling convention of this /// function call. CallingConv::ID getCallingConv() const {