]> granicus.if.org Git - clang/commitdiff
[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
authorChandler Carruth <chandlerc@gmail.com>
Tue, 22 Apr 2014 03:17:02 +0000 (03:17 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 22 Apr 2014 03:17:02 +0000 (03:17 +0000)
definition below all of the header #include lines, clang edition.

If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206849 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
lib/Analysis/CallGraph.cpp
lib/Format/BreakableToken.cpp
lib/Format/ContinuationIndenter.cpp
lib/Format/Format.cpp
lib/Format/UnwrappedLineParser.cpp
lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
unittests/Format/FormatTest.cpp
unittests/Format/FormatTestJS.cpp
unittests/Format/FormatTestProto.cpp

index 649ba57bf5811e9bd17d115408427e987fcb02e8..f78f6740d4f64111dc17eff10019d3120d4a2ac8 100644 (file)
@@ -10,8 +10,6 @@
 //  This file defines the AST-based CallGraph.
 //
 //===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "CallGraph"
-
 #include "clang/Analysis/CallGraph.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
@@ -22,6 +20,8 @@
 
 using namespace clang;
 
+#define DEBUG_TYPE "CallGraph"
+
 STATISTIC(NumObjCCallEdges, "Number of Objective-C method call edges");
 STATISTIC(NumBlockCallEdges, "Number of block call edges");
 
index 40b53f3026ed7a374af307c3892308f16af0c623..93cca66634009d087dab6d6c05e397c8297d4f70 100644 (file)
@@ -13,8 +13,6 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-token-breaker"
-
 #include "BreakableToken.h"
 #include "clang/Basic/CharInfo.h"
 #include "clang/Format/Format.h"
@@ -22,6 +20,8 @@
 #include "llvm/Support/Debug.h"
 #include <algorithm>
 
+#define DEBUG_TYPE "format-token-breaker"
+
 namespace clang {
 namespace format {
 
index de2047c458f9ef6c751c0bffc4a579340259f312..445fc41ad22dffcc8a7d5e0211674a690f4de8dd 100644 (file)
@@ -12,8 +12,6 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-formatter"
-
 #include "BreakableToken.h"
 #include "ContinuationIndenter.h"
 #include "WhitespaceManager.h"
@@ -23,6 +21,8 @@
 #include "llvm/Support/Debug.h"
 #include <string>
 
+#define DEBUG_TYPE "format-formatter"
+
 namespace clang {
 namespace format {
 
index 92b98552ff3dcfcf1921c8a71e4c75ccc95e0749..3544cff4ddbeb4057cfb1bf657527399156a44ce 100644 (file)
@@ -13,8 +13,6 @@
 ///
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-formatter"
-
 #include "ContinuationIndenter.h"
 #include "TokenAnnotator.h"
 #include "UnwrappedLineParser.h"
@@ -31,6 +29,8 @@
 #include <queue>
 #include <string>
 
+#define DEBUG_TYPE "format-formatter"
+
 using clang::format::FormatStyle;
 
 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string)
index d63b38bcd1ac12023112e16c88323b6dfbd912b3..8dd32d5f717a0b0e4bfc4565eff8184f0f19fa66 100644 (file)
 ///
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-parser"
-
 #include "UnwrappedLineParser.h"
 #include "llvm/Support/Debug.h"
 
+#define DEBUG_TYPE "format-parser"
+
 namespace clang {
 namespace format {
 
index 3becdca97d83d922a76637f106631026b9cb170d..97887dcd536084ce6a68f945e11d966b4bfb62ed 100644 (file)
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 // This file reports various statistics about analyzer visitation.
 //===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "StatsChecker"
-
 #include "ClangSACheckers.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/Basic/SourceManager.h"
@@ -26,6 +24,8 @@
 using namespace clang;
 using namespace ento;
 
+#define DEBUG_TYPE "StatsChecker"
+
 STATISTIC(NumBlocks,
           "The # of blocks in top level functions");
 STATISTIC(NumBlocksUnreachable,
index a08a2269c9d48a119a3a0bcd3f34ad84f1cc5067..ea6af07f347835a6ef9d4d4cde3cd084ceee3d04 100644 (file)
@@ -12,8 +12,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "BugReporter"
-
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
@@ -40,6 +38,8 @@
 using namespace clang;
 using namespace ento;
 
+#define DEBUG_TYPE "BugReporter"
+
 STATISTIC(MaxBugClassSize,
           "The maximum number of bug reports in the same equivalence class");
 STATISTIC(MaxValidBugClassSize,
index 897164b608b22f617817532cd19222a3a02d0074..edba501e6e92f4c1d59ca2a903286ad09a79638a 100644 (file)
@@ -12,8 +12,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "CoreEngine"
-
 #include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/StmtCXX.h"
@@ -26,6 +24,8 @@
 using namespace clang;
 using namespace ento;
 
+#define DEBUG_TYPE "CoreEngine"
+
 STATISTIC(NumSteps,
             "The # of steps executed.");
 STATISTIC(NumReachedMaxSteps,
index e7f49b279c0038b617613b2bcb7f2f55e94839fe..fd77e710b8351c0883da7939ae09c96b8d2667ba 100644 (file)
@@ -13,8 +13,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "ExprEngine"
-
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
 #include "PrettyStackTraceLocationContext.h"
 #include "clang/AST/CharUnits.h"
@@ -40,6 +38,8 @@ using namespace clang;
 using namespace ento;
 using llvm::APSInt;
 
+#define DEBUG_TYPE "ExprEngine"
+
 STATISTIC(NumRemoveDeadBindings,
             "The # of times RemoveDeadBindings is called");
 STATISTIC(NumMaxBlockCountReached,
index 72af75dba7ad3fcc2468023ede517658e2013767..bffae0037cb134e0860a92720f41417b96d932a8 100644 (file)
@@ -11,8 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "ExprEngine"
-
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
 #include "PrettyStackTraceLocationContext.h"
 #include "clang/AST/CXXInheritance.h"
@@ -28,6 +26,8 @@
 using namespace clang;
 using namespace ento;
 
+#define DEBUG_TYPE "ExprEngine"
+
 STATISTIC(NumOfDynamicDispatchPathSplits,
   "The # of times we split the path due to imprecise dynamic dispatch info");
 
index 563924d46e105c16b0c26612d1bc4ee3dc708415..3ce76e2d7fff30b155e2e6f2dbdd90dd915ed051 100644 (file)
@@ -11,8 +11,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "AnalysisConsumer"
-
 #include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
 #include "clang/AST/ASTConsumer.h"
 #include "clang/AST/DataRecursiveASTVisitor.h"
@@ -51,6 +49,8 @@ using namespace clang;
 using namespace ento;
 using llvm::SmallPtrSet;
 
+#define DEBUG_TYPE "AnalysisConsumer"
+
 static ExplodedNode::Auditor* CreateUbiViz();
 
 STATISTIC(NumFunctionTopLevel, "The # of functions at top level.");
index 4c74ed61aac1c676b9620e724a2db3ec56edcbd1..398850c38ace6519206fd18f27ff488023337fbd 100644 (file)
@@ -7,13 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-test"
-
 #include "FormatTestUtils.h"
 #include "clang/Format/Format.h"
 #include "llvm/Support/Debug.h"
 #include "gtest/gtest.h"
 
+#define DEBUG_TYPE "format-test"
+
 namespace clang {
 namespace format {
 
index c0215e7d142db86573555a396dcbb1054fb7a833..e7ca14f595d1a54d1ae6c8d9c8aa98e73865409e 100644 (file)
@@ -7,13 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-test"
-
 #include "FormatTestUtils.h"
 #include "clang/Format/Format.h"
 #include "llvm/Support/Debug.h"
 #include "gtest/gtest.h"
 
+#define DEBUG_TYPE "format-test"
+
 namespace clang {
 namespace format {
 
index 84d0d7d32ee7d5e6322e7cfba78e016f308206f6..b3dd354b2c9c955b8af45cef39161076ac702730 100644 (file)
@@ -7,13 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "format-test"
-
 #include "FormatTestUtils.h"
 #include "clang/Format/Format.h"
 #include "llvm/Support/Debug.h"
 #include "gtest/gtest.h"
 
+#define DEBUG_TYPE "format-test"
+
 namespace clang {
 namespace format {