summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
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
commit2ad5aa8334563a631f2098d69abddb616bde66b8 (patch)
treeca13bc45eded13252673234ec64aff14c1964890 /llvm/lib/VMCore
parenta4c8022caf154583ef6d13a356af99257ac52709 (diff)
downloadbcm5719-llvm-2ad5aa8334563a631f2098d69abddb616bde66b8.tar.gz
bcm5719-llvm-2ad5aa8334563a631f2098d69abddb616bde66b8.zip
Verify that varargs functions all have ccc
llvm-svn: 21792
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index ab9e60cc3ee..753a75ea0cf 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud