Provide the option to run the CF-retain checker in GC enabled mode.
The transfer functions for the checker don't do anything special yet in GC mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50394 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index ad72d27..730c531 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -590,7 +590,8 @@
private:
// Instance variables.
- CFRefSummaryManager Summaries;
+ CFRefSummaryManager Summaries;
+ const bool GCEnabled;
RefBFactoryTy RefBFactory;
UseAfterReleasesTy UseAfterReleases;
@@ -636,8 +637,9 @@
public:
- CFRefCount(ASTContext& Ctx)
+ CFRefCount(ASTContext& Ctx, bool gcenabled)
: Summaries(Ctx),
+ GCEnabled(gcenabled),
RetainSelector(GetUnarySelector("retain", Ctx)),
ReleaseSelector(GetUnarySelector("release", Ctx)) {}
@@ -1575,6 +1577,6 @@
// Transfer function creation for external clients.
//===----------------------------------------------------------------------===//
-GRTransferFuncs* clang::MakeCFRefCountTF(ASTContext& Ctx) {
- return new CFRefCount(Ctx);
+GRTransferFuncs* clang::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled) {
+ return new CFRefCount(Ctx, GCEnabled);
}