[llvm] aecd75f - Analysis: move declaration of variables to a more suitable location

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 09:19:42 PDT 2021


Author: Saleem Abdulrasool
Date: 2021-09-08T09:19:09-07:00
New Revision: aecd75f0953e01881c874da20cc2ec8fdf525577

URL: https://github.com/llvm/llvm-project/commit/aecd75f0953e01881c874da20cc2ec8fdf525577
DIFF: https://github.com/llvm/llvm-project/commit/aecd75f0953e01881c874da20cc2ec8fdf525577.diff

LOG: Analysis: move declaration of variables to a more suitable location

This moves 2 variable declarations from `llvm/Support/Debug.h` to a more
appropriate home in the headers for `LLVMAnalysis`.  These variables are
defined in `LLVMAnalysis` rather than in `LLVMSupport` and although they
control debugging behavior, the declarations being colocated in the same
library's headers is both easier to locate and aids correctly describing
the library's interfaces.

Reviewed By: rnk, mehdi_amini, aeubanks

Differential Revision: https://reviews.llvm.org/D109396

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/LoopInfo.h
    llvm/include/llvm/Analysis/MemorySSA.h
    llvm/include/llvm/Support/Debug.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 8625f75e42592..ece37dc693cd4 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -1213,6 +1213,13 @@ class LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
 
 };
 
+/// Enable verification of loop info.
+///
+/// The flag enables checks which are expensive and are disabled by default
+/// unless the `EXPENSIVE_CHECKS` macro is defined.  The `-verify-loop-info`
+/// flag allows the checks to be enabled selectively without re-compilation.
+extern bool VerifyLoopInfo;
+
 // Allow clients to walk the list of nested loops...
 template <> struct GraphTraits<const Loop *> {
   typedef const Loop *NodeRef;

diff  --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index a05cefacceec4..afa89af636728 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -894,6 +894,13 @@ class MemorySSA {
   unsigned NextID;
 };
 
+/// Enables verification of MemorySSA.
+///
+/// The checks which this flag enables is exensive and disabled by default
+/// unless `EXPENSIVE_CHECKS` is defined.  The flag `-verify-memoryssa` can be
+/// used to selectively enable the verification without re-compilation.
+extern bool VerifyMemorySSA;
+
 // Internal MemorySSA utils, for use by MemorySSA classes and walkers
 class MemorySSAUtil {
 protected:

diff  --git a/llvm/include/llvm/Support/Debug.h b/llvm/include/llvm/Support/Debug.h
index 184a3f363fda8..2ff978476c79f 100644
--- a/llvm/include/llvm/Support/Debug.h
+++ b/llvm/include/llvm/Support/Debug.h
@@ -78,23 +78,6 @@ void setCurrentDebugTypes(const char **Types, unsigned Count);
 ///
 extern bool DebugFlag;
 
-/// \name Verification flags.
-///
-/// These flags turns on/off that are expensive and are turned off by default,
-/// unless macro EXPENSIVE_CHECKS is defined. The flags allow selectively
-/// turning the checks on without need to recompile.
-/// \{
-
-/// Enables verification of loop info.
-///
-extern bool VerifyLoopInfo;
-
-/// Enables verification of MemorySSA.
-///
-extern bool VerifyMemorySSA;
-
-///\}
-
 /// EnableDebugBuffering - This defaults to false.  If true, the debug
 /// stream will install signal handlers to dump any buffered debug
 /// output.  It allows clients to selectively allow the debug stream


        


More information about the llvm-commits mailing list