Don't put default parameter values into .cpp files, it breaks 3.x compilers
[oota-llvm.git] / lib / CodeGen / MachineInstrAnnot.cpp
1 //===-- MachineInstrAnnot.cpp ---------------------------------------------===//
2 // 
3 //  This file defines Annotations used to pass information between code
4 //  generation phases.
5 // 
6 //===----------------------------------------------------------------------===//
7
8 #include "llvm/CodeGen/MachineInstrAnnot.h"
9 #include "llvm/Annotation.h"
10 #include "llvm/iOther.h"
11
12 AnnotationID CallArgsDescriptor::AID(AnnotationManager::
13                                      getID("CodeGen::CallArgsDescriptor"));
14
15 CallArgsDescriptor::CallArgsDescriptor(const CallInst* _callInstr,
16                                        TmpInstruction* _retAddrReg,
17                                        bool _isVarArgs, bool _noPrototype)
18   : Annotation(AID),
19     callInstr(_callInstr),
20     funcPtr(isa<Function>(_callInstr->getCalledValue())
21             ? NULL : _callInstr->getCalledValue()),
22     retAddrReg(_retAddrReg),
23     isVarArgs(_isVarArgs),
24     noPrototype(_noPrototype)
25 {
26   unsigned int numArgs = callInstr->getNumOperands();
27   argInfoVec.reserve(numArgs);
28   assert(callInstr->getOperand(0) == callInstr->getCalledValue()
29          && "Operand 0 is ignored in the loop below!");
30   for (unsigned int i=1; i < numArgs; ++i)
31     argInfoVec.push_back(CallArgInfo(callInstr->getOperand(i)));
32 }