aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineInstrAnnot.cpp
blob: c5c0c3fe099e84ca58eaeab52db3b5f7da94834a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// $Id$ -*-c++-*-
//***************************************************************************
// File:
//	MachineInstrAnnot.cpp
// 
// Purpose:
//      Annotations used to pass information between code generation phases.
// 
// History:
//	5/10/02	 -  Vikram Adve  -  Created
//**************************************************************************/

#include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/Annotation.h"
#include "llvm/iOther.h"
#include <vector>


AnnotationID CallArgsDescriptor::AID(AnnotationManager::
                                     getID("CodeGen::CallArgsDescriptor"));

CallArgsDescriptor::CallArgsDescriptor(const CallInst* _callInstr,
                                       TmpInstruction* _retAddrReg,
                                       bool _isVarArgs, bool _noPrototype)
  : Annotation(AID),
    callInstr(_callInstr),
    funcPtr(isa<Function>(_callInstr->getCalledValue())
            ? NULL : _callInstr->getCalledValue()),
    retAddrReg(_retAddrReg),
    isVarArgs(_isVarArgs),
    noPrototype(_noPrototype)
{
  unsigned int numArgs = callInstr->getNumOperands();
  argInfoVec.reserve(numArgs);
  assert(callInstr->getOperand(0) == callInstr->getCalledValue()
         && "Operand 0 is ignored in the loop below!");
  for (unsigned int i=1; i < numArgs; ++i)
    argInfoVec.push_back(CallArgInfo(callInstr->getOperand(i)));
}