summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Lint.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-12 18:02:04 +0000
committerDan Gohman <gohman@apple.com>2010-07-12 18:02:04 +0000
commitc128e70ff2fdb5a72fa958c5c429a3f442a6decc (patch)
tree1ad9d2b9c3ce25cb32e5c7fb4f856814eade3ab6 /llvm/lib/Analysis/Lint.cpp
parent86033407c9217fe0561d0e90253590b1b6dc40df (diff)
downloadbcm5719-llvm-c128e70ff2fdb5a72fa958c5c429a3f442a6decc.tar.gz
bcm5719-llvm-c128e70ff2fdb5a72fa958c5c429a3f442a6decc.zip
Add a lint check for mismatched return types, inspired by PR6944.
llvm-svn: 108162
Diffstat (limited to 'llvm/lib/Analysis/Lint.cpp')
-rw-r--r--llvm/lib/Analysis/Lint.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp
index 60654e61701..9f1b30d2cf4 100644
--- a/llvm/lib/Analysis/Lint.cpp
+++ b/llvm/lib/Analysis/Lint.cpp
@@ -225,6 +225,10 @@ void Lint::visitCallSite(CallSite CS) {
"Undefined behavior: Call argument count mismatches callee "
"argument count", &I);
+ Assert1(FT->getReturnType() == I.getType(),
+ "Undefined behavior: Call return type mismatches "
+ "callee return type", &I);
+
// Check argument types (in case the callee was casted) and attributes.
// TODO: Verify that caller and callee attributes are compatible.
Function::arg_iterator PI = F->arg_begin(), PE = F->arg_end();
OpenPOWER on IntegriCloud