2002-08-09 20:08:06 +00:00
|
|
|
//===-- MachineInstrAnnot.cpp ---------------------------------------------===//
|
2002-05-19 15:30:21 +00:00
|
|
|
//
|
2002-08-09 20:08:06 +00:00
|
|
|
// This file defines Annotations used to pass information between code
|
|
|
|
// generation phases.
|
2002-05-19 15:30:21 +00:00
|
|
|
//
|
2002-08-09 20:08:06 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-05-19 15:30:21 +00:00
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineInstrAnnot.h"
|
|
|
|
#include "llvm/Annotation.h"
|
|
|
|
#include "llvm/iOther.h"
|
2002-10-28 02:28:39 +00:00
|
|
|
#include "llvm/Type.h"
|
2002-05-19 15:30:21 +00:00
|
|
|
|
|
|
|
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)));
|
|
|
|
}
|
2002-09-28 17:03:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
const CallInst*
|
|
|
|
CallArgsDescriptor::getReturnValue() const
|
|
|
|
{
|
|
|
|
return (callInstr->getType() == Type::VoidTy? NULL : callInstr);
|
|
|
|
}
|