[objc-arc] Added an option to arc-annotations for turning off CheckForCFGHazard.
llvm-svn: 179717
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
index cddf00b..bf1c93d 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -710,6 +710,9 @@
/// Enable/disable ARC sequence annotations.
static cl::opt<bool>
EnableARCAnnotations("enable-objc-arc-annotations", cl::init(false));
+static cl::opt<bool>
+EnableCheckForCFGHazards("enable-objc-arc-checkforcfghazards",
+ cl::init(true));
/// This function appends a unique ARCAnnotationProvenanceSourceMDKind id to an
/// instruction so that we can track backwards when post processing via the llvm
@@ -2170,6 +2173,9 @@
// bottom of the basic block.
ANNOTATE_TOPDOWN_BBEND(MyStates, BB);
+#ifdef ARC_ANNOTATIONS
+ if (EnableARCAnnotations && EnableCheckForCFGHazards)
+#endif
CheckForCFGHazards(BB, BBStates, MyStates);
return NestingDetected;
}