1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/lib/CodeGen/MachineInstrAnnot.cpp
Vikram S. Adve 1f8badf623 Annotation class for MachineInstr.
llvm-svn: 2643
2002-05-19 15:30:21 +00:00

40 lines
1.3 KiB
C++

// $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)));
}