[llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu May 8 10:56:01 PDT 2003
Changes in directory llvm/lib/VMCore:
Verifier.cpp updated: 1.48 -> 1.49
---
Log message:
llvm.va_start only takes on argument now
Verify that va_start doesn't occur in functions with no varargs
---
Diffs of the changes:
Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.48 llvm/lib/VMCore/Verifier.cpp:1.49
--- llvm/lib/VMCore/Verifier.cpp:1.48 Wed May 7 22:47:33 2003
+++ llvm/lib/VMCore/Verifier.cpp Thu May 8 10:55:31 2003
@@ -131,7 +131,7 @@
void visitPHINode(PHINode &PN);
void visitBinaryOperator(BinaryOperator &B);
void visitShiftInst(ShiftInst &SI);
- void visitVarArgInst(VarArgInst &VAI);
+ void visitVarArgInst(VarArgInst &VAI) { visitInstruction(VAI); }
void visitCallInst(CallInst &CI);
void visitGetElementPtrInst(GetElementPtrInst &GEP);
void visitLoadInst(LoadInst &LI);
@@ -409,13 +409,6 @@
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 =
GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
@@ -519,9 +512,10 @@
switch (ID) {
case LLVMIntrinsic::va_start:
- Assert1(isa<Argument>(CI.getOperand(2)),
- "va_start second argument should be a function argument!", &CI);
- NumArgs = 2;
+ Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
+ "llvm.va_start intrinsic may only occur in function with variable"
+ " args!", &CI);
+ NumArgs = 1;
break;
case LLVMIntrinsic::va_end: NumArgs = 1; break;
case LLVMIntrinsic::va_copy: NumArgs = 2; break;
More information about the llvm-commits
mailing list