summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-17 04:01:35 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-17 04:01:35 +0000
commit6fa1daede52acb83bdfe66f2c1cbab2562e13763 (patch)
tree412b36ebde4921f01a0ed14e6c9ffea933359dc3 /clang/lib
parent3e5ad5932e02635873f545c4379a6a57ec4e242a (diff)
downloadbcm5719-llvm-6fa1daede52acb83bdfe66f2c1cbab2562e13763.tar.gz
bcm5719-llvm-6fa1daede52acb83bdfe66f2c1cbab2562e13763.zip
Teach VariadicMethodTypeChecker that CF references are valid arguments to variadic Objective-C methods.
llvm-svn: 127797
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 792b720b8fb..51847094dad 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -14,6 +14,7 @@
//===----------------------------------------------------------------------===//
#include "ClangSACheckers.h"
+#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
@@ -594,6 +595,10 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(ObjCMessage msg,
// Ignore pointer constants.
if (isa<loc::ConcreteInt>(msg.getArgSVal(I, state)))
continue;
+
+ // Ignore CF references, which can be toll-free bridged.
+ if (cocoa::isCFObjectRef(ArgTy))
+ continue;
// Generate only one error node to use for all bug reports.
if (!errorNode.hasValue()) {
OpenPOWER on IntegriCloud