Vikram S. Adve | 7e684a9 | 2002-05-19 15:30:21 +0000 | [diff] [blame^] | 1 | // $Id$ -*-c++-*- |
| 2 | //*************************************************************************** |
| 3 | // File: |
| 4 | // MachineInstrAnnot.cpp |
| 5 | // |
| 6 | // Purpose: |
| 7 | // Annotations used to pass information between code generation phases. |
| 8 | // |
| 9 | // History: |
| 10 | // 5/10/02 - Vikram Adve - Created |
| 11 | //**************************************************************************/ |
| 12 | |
| 13 | #include "llvm/CodeGen/MachineInstrAnnot.h" |
| 14 | #include "llvm/Annotation.h" |
| 15 | #include "llvm/iOther.h" |
| 16 | #include <vector> |
| 17 | |
| 18 | |
| 19 | AnnotationID CallArgsDescriptor::AID(AnnotationManager:: |
| 20 | getID("CodeGen::CallArgsDescriptor")); |
| 21 | |
| 22 | CallArgsDescriptor::CallArgsDescriptor(const CallInst* _callInstr, |
| 23 | TmpInstruction* _retAddrReg, |
| 24 | bool _isVarArgs, bool _noPrototype) |
| 25 | : Annotation(AID), |
| 26 | callInstr(_callInstr), |
| 27 | funcPtr(isa<Function>(_callInstr->getCalledValue()) |
| 28 | ? NULL : _callInstr->getCalledValue()), |
| 29 | retAddrReg(_retAddrReg), |
| 30 | isVarArgs(_isVarArgs), |
| 31 | noPrototype(_noPrototype) |
| 32 | { |
| 33 | unsigned int numArgs = callInstr->getNumOperands(); |
| 34 | argInfoVec.reserve(numArgs); |
| 35 | assert(callInstr->getOperand(0) == callInstr->getCalledValue() |
| 36 | && "Operand 0 is ignored in the loop below!"); |
| 37 | for (unsigned int i=1; i < numArgs; ++i) |
| 38 | argInfoVec.push_back(CallArgInfo(callInstr->getOperand(i))); |
| 39 | } |