Make Scheduling Class variables be 'unsigned' instead of 'int'
[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 #include "llvm/Type.h"
12
13 AnnotationID CallArgsDescriptor::AID(AnnotationManager::
14                                      getID("CodeGen::CallArgsDescriptor"));
15
16 CallArgsDescriptor::CallArgsDescriptor(const CallInst* _callInstr,
17                                        TmpInstruction* _retAddrReg,
18                                        bool _isVarArgs, bool _noPrototype)
19   : Annotation(AID),
20     callInstr(_callInstr),
21     funcPtr(isa<Function>(_callInstr->getCalledValue())
22             ? NULL : _callInstr->getCalledValue()),
23     retAddrReg(_retAddrReg),
24     isVarArgs(_isVarArgs),
25     noPrototype(_noPrototype)
26 {
27   unsigned int numArgs = callInstr->getNumOperands();
28   argInfoVec.reserve(numArgs);
29   assert(callInstr->getOperand(0) == callInstr->getCalledValue()
30          && "Operand 0 is ignored in the loop below!");
31   for (unsigned int i=1; i < numArgs; ++i)
32     argInfoVec.push_back(CallArgInfo(callInstr->getOperand(i)));
33 }
34
35
36 const CallInst*
37 CallArgsDescriptor::getReturnValue() const
38 {
39   return (callInstr->getType() == Type::VoidTy? NULL : callInstr);
40 }