[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Instruction.cpp Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed May 7 21:45:04 PDT 2003
Changes in directory llvm/lib/VMCore:
AsmWriter.cpp updated: 1.85 -> 1.86
Instruction.cpp updated: 1.21 -> 1.22
Verifier.cpp updated: 1.46 -> 1.47
---
Log message:
Add support for the new va_arg instruction
---
Diffs of the changes:
Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.85 llvm/lib/VMCore/AsmWriter.cpp:1.86
--- llvm/lib/VMCore/AsmWriter.cpp:1.85 Wed May 7 21:08:14 2003
+++ llvm/lib/VMCore/AsmWriter.cpp Wed May 7 21:44:12 2003
@@ -3,8 +3,7 @@
// This library implements the functionality defined in llvm/Assembly/Writer.h
//
// Note that these routines must be extremely tolerant of various errors in the
-// LLVM code, because of of the primary uses of it is for debugging
-// transformations.
+// LLVM code, because it can be used for debugging transformations.
//
//===----------------------------------------------------------------------===//
@@ -814,8 +813,12 @@
writeOperand(AI->getArraySize(), true);
}
} else if (isa<CastInst>(I)) {
- if (Operand) writeOperand(Operand, true);
+ writeOperand(Operand, true);
Out << " to ";
+ printType(I.getType());
+ } else if (isa<VarArgInst>(I)) {
+ writeOperand(Operand, true);
+ Out << ", ";
printType(I.getType());
} else if (Operand) { // Print the normal way...
Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.21 llvm/lib/VMCore/Instruction.cpp:1.22
--- llvm/lib/VMCore/Instruction.cpp:1.21 Wed Nov 20 12:33:41 2002
+++ llvm/lib/VMCore/Instruction.cpp Wed May 7 21:44:12 2003
@@ -91,7 +91,8 @@
case Call: return "call";
case Shl: return "shl";
case Shr: return "shr";
-
+ case VarArg: return "va_arg";
+
default: return "<Invalid operator> ";
}
Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.46 llvm/lib/VMCore/Verifier.cpp:1.47
--- llvm/lib/VMCore/Verifier.cpp:1.46 Fri Apr 18 19:50:37 2003
+++ llvm/lib/VMCore/Verifier.cpp Wed May 7 21:44:12 2003
@@ -130,6 +130,7 @@
void visitPHINode(PHINode &PN);
void visitBinaryOperator(BinaryOperator &B);
void visitShiftInst(ShiftInst &SI);
+ void visitVarArgInst(VarArgInst &VAI);
void visitCallInst(CallInst &CI);
void visitGetElementPtrInst(GetElementPtrInst &GEP);
void visitLoadInst(LoadInst &LI);
@@ -402,7 +403,12 @@
visitInstruction(SI);
}
-
+void Verifier::visitVarArgInst(VarArgInst &VAI) {
+ Assert1(VAI.getParent()->getParent()->getFunctionType()->isVarArg(),
+ "va_arg instruction may only occur in function with variable args!",
+ &VAI);
+ visitInstruction(VAI);
+}
void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
const Type *ElTy =
More information about the llvm-commits
mailing list