Skip to content

Commit f1221bd

Browse files
committed
[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all the header #include lines, lib/Analysis/... edition. This one has a bit extra as there were *other* #define's before #include lines in addition to DEBUG_TYPE. I've sunk all of them as a block. llvm-svn: 206843
1 parent 84e68b2 commit f1221bd

21 files changed

+44
-25
lines changed

llvm/lib/Analysis/BlockFrequencyInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "block-freq"
1514
#include "llvm/Analysis/BlockFrequencyInfo.h"
1615
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
1716
#include "llvm/Analysis/BranchProbabilityInfo.h"
@@ -25,6 +24,8 @@
2524

2625
using namespace llvm;
2726

27+
#define DEBUG_TYPE "block-freq"
28+
2829
#ifndef NDEBUG
2930
enum GVDAGType {
3031
GVDT_None,

llvm/lib/Analysis/BranchProbabilityInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "branch-prob"
1514
#include "llvm/Analysis/BranchProbabilityInfo.h"
1615
#include "llvm/ADT/PostOrderIterator.h"
1716
#include "llvm/Analysis/LoopInfo.h"
@@ -25,6 +24,8 @@
2524

2625
using namespace llvm;
2726

27+
#define DEBUG_TYPE "branch-prob"
28+
2829
INITIALIZE_PASS_BEGIN(BranchProbabilityInfo, "branch-prob",
2930
"Branch Probability Analysis", false, true)
3031
INITIALIZE_PASS_DEPENDENCY(LoopInfo)

llvm/lib/Analysis/CostModel.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#define CM_NAME "cost-model"
21-
#define DEBUG_TYPE CM_NAME
2220
#include "llvm/ADT/STLExtras.h"
2321
#include "llvm/Analysis/Passes.h"
2422
#include "llvm/Analysis/TargetTransformInfo.h"
@@ -32,6 +30,9 @@
3230
#include "llvm/Support/raw_ostream.h"
3331
using namespace llvm;
3432

33+
#define CM_NAME "cost-model"
34+
#define DEBUG_TYPE CM_NAME
35+
3536
static cl::opt<bool> EnableReduxCost("costmodel-reduxcost", cl::init(false),
3637
cl::Hidden,
3738
cl::desc("Recognize reduction patterns."));

llvm/lib/Analysis/Delinearization.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#define DL_NAME "delinearize"
18-
#define DEBUG_TYPE DL_NAME
1917
#include "llvm/IR/Constants.h"
2018
#include "llvm/Analysis/LoopInfo.h"
2119
#include "llvm/Analysis/Passes.h"
@@ -34,6 +32,9 @@
3432

3533
using namespace llvm;
3634

35+
#define DL_NAME "delinearize"
36+
#define DEBUG_TYPE DL_NAME
37+
3738
namespace {
3839

3940
class Delinearization : public FunctionPass {

llvm/lib/Analysis/DependenceAnalysis.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
// //
5252
//===----------------------------------------------------------------------===//
5353

54-
#define DEBUG_TYPE "da"
55-
5654
#include "llvm/Analysis/DependenceAnalysis.h"
5755
#include "llvm/ADT/Statistic.h"
5856
#include "llvm/Analysis/AliasAnalysis.h"
@@ -69,6 +67,8 @@
6967

7068
using namespace llvm;
7169

70+
#define DEBUG_TYPE "da"
71+
7272
//===----------------------------------------------------------------------===//
7373
// statistics
7474

llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#define DEBUG_TYPE "cgscc-passmgr"
1918
#include "llvm/Analysis/CallGraphSCCPass.h"
2019
#include "llvm/ADT/SCCIterator.h"
2120
#include "llvm/ADT/Statistic.h"
@@ -29,6 +28,8 @@
2928
#include "llvm/Support/raw_ostream.h"
3029
using namespace llvm;
3130

31+
#define DEBUG_TYPE "cgscc-passmgr"
32+
3233
static cl::opt<unsigned>
3334
MaxIterations("max-cg-scc-iterations", cl::ReallyHidden, cl::init(4));
3435

llvm/lib/Analysis/IPA/GlobalsModRef.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#define DEBUG_TYPE "globalsmodref-aa"
1817
#include "llvm/Analysis/Passes.h"
1918
#include "llvm/ADT/SCCIterator.h"
2019
#include "llvm/ADT/Statistic.h"
@@ -33,6 +32,8 @@
3332
#include <set>
3433
using namespace llvm;
3534

35+
#define DEBUG_TYPE "globalsmodref-aa"
36+
3637
STATISTIC(NumNonAddrTakenGlobalVars,
3738
"Number of global vars without address taken");
3839
STATISTIC(NumNonAddrTakenFunctions,"Number of functions without address taken");

llvm/lib/Analysis/IPA/InlineCost.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "inline-cost"
1514
#include "llvm/Analysis/InlineCost.h"
1615
#include "llvm/ADT/STLExtras.h"
1716
#include "llvm/ADT/SetVector.h"
@@ -34,6 +33,8 @@
3433

3534
using namespace llvm;
3635

36+
#define DEBUG_TYPE "inline-cost"
37+
3738
STATISTIC(NumCallsAnalyzed, "Number of call sites analyzed");
3839

3940
namespace {

llvm/lib/Analysis/IVUsers.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#define DEBUG_TYPE "iv-users"
1615
#include "llvm/Analysis/IVUsers.h"
1716
#include "llvm/ADT/STLExtras.h"
1817
#include "llvm/Analysis/LoopPass.h"
@@ -29,6 +28,8 @@
2928
#include <algorithm>
3029
using namespace llvm;
3130

31+
#define DEBUG_TYPE "iv-users"
32+
3233
char IVUsers::ID = 0;
3334
INITIALIZE_PASS_BEGIN(IVUsers, "iv-users",
3435
"Induction Variable Users", false, true)

llvm/lib/Analysis/InstCount.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "instcount"
1514
#include "llvm/Analysis/Passes.h"
1615
#include "llvm/ADT/Statistic.h"
1716
#include "llvm/IR/Function.h"
@@ -22,6 +21,8 @@
2221
#include "llvm/Support/raw_ostream.h"
2322
using namespace llvm;
2423

24+
#define DEBUG_TYPE "instcount"
25+
2526
STATISTIC(TotalInsts , "Number of instructions (of all types)");
2627
STATISTIC(TotalBlocks, "Number of basic blocks");
2728
STATISTIC(TotalFuncs , "Number of non-external functions");

llvm/lib/Analysis/InstructionSimplify.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
#define DEBUG_TYPE "instsimplify"
2120
#include "llvm/Analysis/InstructionSimplify.h"
2221
#include "llvm/ADT/SetVector.h"
2322
#include "llvm/ADT/Statistic.h"
@@ -35,6 +34,8 @@
3534
using namespace llvm;
3635
using namespace llvm::PatternMatch;
3736

37+
#define DEBUG_TYPE "instsimplify"
38+
3839
enum { RecursionLimit = 3 };
3940

4041
STATISTIC(NumExpand, "Number of expansions");

llvm/lib/Analysis/LazyCallGraph.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#define DEBUG_TYPE "lcg"
1110
#include "llvm/Analysis/LazyCallGraph.h"
1211
#include "llvm/ADT/STLExtras.h"
1312
#include "llvm/IR/CallSite.h"
@@ -19,6 +18,8 @@
1918

2019
using namespace llvm;
2120

21+
#define DEBUG_TYPE "lcg"
22+
2223
static void findCallees(
2324
SmallVectorImpl<Constant *> &Worklist, SmallPtrSetImpl<Constant *> &Visited,
2425
SmallVectorImpl<PointerUnion<Function *, LazyCallGraph::Node *>> &Callees,

llvm/lib/Analysis/LazyValueInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#define DEBUG_TYPE "lazy-value-info"
1615
#include "llvm/Analysis/LazyValueInfo.h"
1716
#include "llvm/ADT/DenseSet.h"
1817
#include "llvm/ADT/STLExtras.h"
@@ -34,6 +33,8 @@
3433
using namespace llvm;
3534
using namespace PatternMatch;
3635

36+
#define DEBUG_TYPE "lazy-value-info"
37+
3738
char LazyValueInfo::ID = 0;
3839
INITIALIZE_PASS_BEGIN(LazyValueInfo, "lazy-value-info",
3940
"Lazy Value Information Analysis", false, true)

llvm/lib/Analysis/MemoryBuiltins.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#define DEBUG_TYPE "memory-builtins"
1615
#include "llvm/Analysis/MemoryBuiltins.h"
1716
#include "llvm/ADT/STLExtras.h"
1817
#include "llvm/ADT/Statistic.h"
@@ -30,6 +29,8 @@
3029
#include "llvm/Transforms/Utils/Local.h"
3130
using namespace llvm;
3231

32+
#define DEBUG_TYPE "memory-builtins"
33+
3334
enum AllocType {
3435
OpNewLike = 1<<0, // allocates; never returns null
3536
MallocLike = 1<<1 | OpNewLike, // allocates; may return null

llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17-
#define DEBUG_TYPE "memdep"
1817
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
1918
#include "llvm/ADT/STLExtras.h"
2019
#include "llvm/ADT/Statistic.h"
@@ -33,6 +32,8 @@
3332
#include "llvm/Support/Debug.h"
3433
using namespace llvm;
3534

35+
#define DEBUG_TYPE "memdep"
36+
3637
STATISTIC(NumCacheNonLocal, "Number of fully cached non-local responses");
3738
STATISTIC(NumCacheDirtyNonLocal, "Number of dirty cached non-local responses");
3839
STATISTIC(NumUncacheNonLocal, "Number of uncached non-local responses");

llvm/lib/Analysis/PostDominators.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#define DEBUG_TYPE "postdomtree"
15-
1614
#include "llvm/Analysis/PostDominators.h"
1715
#include "llvm/ADT/DepthFirstIterator.h"
1816
#include "llvm/ADT/SetOperations.h"
@@ -22,6 +20,8 @@
2220
#include "llvm/Support/GenericDomTreeConstruction.h"
2321
using namespace llvm;
2422

23+
#define DEBUG_TYPE "postdomtree"
24+
2525
//===----------------------------------------------------------------------===//
2626
// PostDominatorTree Implementation
2727
//===----------------------------------------------------------------------===//

llvm/lib/Analysis/RegionInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// Detects single entry single exit regions in the control flow graph.
1010
//===----------------------------------------------------------------------===//
1111

12-
#define DEBUG_TYPE "region"
1312
#include "llvm/Analysis/RegionInfo.h"
1413
#include "llvm/ADT/PostOrderIterator.h"
1514
#include "llvm/ADT/Statistic.h"
@@ -24,6 +23,8 @@
2423

2524
using namespace llvm;
2625

26+
#define DEBUG_TYPE "region"
27+
2728
// Always verify if expensive checking is enabled.
2829
#ifdef XDEBUG
2930
static bool VerifyRegionInfo = true;

llvm/lib/Analysis/RegionPass.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
#include "llvm/Analysis/RegionIterator.h"
1818
#include "llvm/Support/Timer.h"
1919

20-
#define DEBUG_TYPE "regionpassmgr"
2120
#include "llvm/Support/Debug.h"
2221
using namespace llvm;
2322

23+
#define DEBUG_TYPE "regionpassmgr"
24+
2425
//===----------------------------------------------------------------------===//
2526
// RGPassManager
2627
//

llvm/lib/Analysis/ScalarEvolution.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
//
5959
//===----------------------------------------------------------------------===//
6060

61-
#define DEBUG_TYPE "scalar-evolution"
6261
#include "llvm/Analysis/ScalarEvolution.h"
6362
#include "llvm/ADT/STLExtras.h"
6463
#include "llvm/ADT/SmallPtrSet.h"
@@ -89,6 +88,8 @@
8988
#include <algorithm>
9089
using namespace llvm;
9190

91+
#define DEBUG_TYPE "scalar-evolution"
92+
9293
STATISTIC(NumArrayLenItCounts,
9394
"Number of trip counts computed with array length");
9495
STATISTIC(NumTripCountsComputed,

llvm/lib/Analysis/SparsePropagation.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#define DEBUG_TYPE "sparseprop"
1615
#include "llvm/Analysis/SparsePropagation.h"
1716
#include "llvm/IR/Constants.h"
1817
#include "llvm/IR/Function.h"
@@ -21,6 +20,8 @@
2120
#include "llvm/Support/raw_ostream.h"
2221
using namespace llvm;
2322

23+
#define DEBUG_TYPE "sparseprop"
24+
2425
//===----------------------------------------------------------------------===//
2526
// AbstractLatticeFunction Implementation
2627
//===----------------------------------------------------------------------===//

llvm/lib/Analysis/TargetTransformInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#define DEBUG_TYPE "tti"
1110
#include "llvm/Analysis/TargetTransformInfo.h"
1211
#include "llvm/IR/CallSite.h"
1312
#include "llvm/IR/DataLayout.h"
@@ -19,6 +18,8 @@
1918

2019
using namespace llvm;
2120

21+
#define DEBUG_TYPE "tti"
22+
2223
// Setup the analysis group to manage the TargetTransformInfo passes.
2324
INITIALIZE_ANALYSIS_GROUP(TargetTransformInfo, "Target Information", NoTTI)
2425
char TargetTransformInfo::ID = 0;

0 commit comments

Comments
 (0)