aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-08 22:27:09 +0000
committerChris Lattner <sabre@nondot.org>2005-05-08 22:27:09 +0000
commit37c121acf4fc347d9feff892598f79b1940f2875 (patch)
tree2b0d728c81cc9a21051dfe8601fb28a62d4effe8
parentfb217adf92cbfd045614a652be63c710ce6a263d (diff)
Verify that varargs functions all have ccc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21792 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Verifier.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index ab9e60cc3e..753a75ea0c 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -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();