diff options
| author | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
| commit | 754655755def3e37bb2856467313c7fe0e577298 (patch) | |
| tree | fcbdcb7e5e1adbd679c817a6699fe07866503b1e /include/llvm/Instructions.h | |
| parent | cb7f14742a0018d2661dac491e10dc05c4ba80c7 (diff) | |
| download | external_llvm-754655755def3e37bb2856467313c7fe0e577298.zip external_llvm-754655755def3e37bb2856467313c7fe0e577298.tar.gz external_llvm-754655755def3e37bb2856467313c7fe0e577298.tar.bz2 | |
Create new accessors to get arguments for call/invoke instructions. It breaks
encapsulation to force the users of these classes to know about the internal
data structure of the Operands structure. It also can lead to errors, like in
the MSIL writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
| -rw-r--r-- | include/llvm/Instructions.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 413a595..b7b7fce 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -940,6 +940,9 @@ public: /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + unsigned getNumArgOperands() const { return getNumOperands() - 1; } + Value *getArgOperand(unsigned i) const { return getOperand(i + 1); } + /// getCallingConv/setCallingConv - Get or set the calling convention of this /// function call. CallingConv::ID getCallingConv() const { @@ -2432,6 +2435,9 @@ public: /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + unsigned getNumArgOperands() const { return getNumOperands() - 3; } + Value *getArgOperand(unsigned i) const { return getOperand(i); } + /// getCallingConv/setCallingConv - Get or set the calling convention of this /// function call. CallingConv::ID getCallingConv() const { |
