Verify that varargs functions all have ccc

llvm-svn: 21792
This commit is contained in:
Chris Lattner 2005-05-08 22:27:09 +00:00
parent a4c8022caf
commit 2ad5aa8334
1 changed files with 5 additions and 1 deletions

View File

@ -41,6 +41,7 @@
#include "llvm/Analysis/Verifier.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/Pass.h"
#include "llvm/Module.h"
@ -294,7 +295,10 @@ void Verifier::verifySymbolTable(SymbolTable &ST) {
// visitFunction - Verify that a function is ok.
//
void Verifier::visitFunction(Function &F) {
// Check function arguments...
Assert1(!F.isVarArg() || F.getCallingConv() == CallingConv::C,
"Varargs functions must have C calling conventions!", &F);
// Check function arguments.
const FunctionType *FT = F.getFunctionType();
unsigned NumArgs = F.getArgumentList().size();