Teach VariadicMethodTypeChecker that CF references are valid arguments to variadic Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127797 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 792b720..5184709 100644
--- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/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 @@
// 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()) {