aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstrAnnot.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:30:21 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-05-19 15:30:21 +0000
commit7e684a956a70980160ff038047fd5f6696461db4 (patch)
tree4cb0a8c052f7a9b28c3ccec800229408046ecd2b /lib/CodeGen/MachineInstrAnnot.cpp
parentdabb41d93de9b2d8f2d506caf611311bce6a188c (diff)
Annotation class for MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstrAnnot.cpp')
-rw-r--r--lib/CodeGen/MachineInstrAnnot.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstrAnnot.cpp b/lib/CodeGen/MachineInstrAnnot.cpp
new file mode 100644
index 0000000000..c5c0c3fe09
--- /dev/null
+++ b/lib/CodeGen/MachineInstrAnnot.cpp
@@ -0,0 +1,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)));
+}