Skip to content

Commit 096f02b

Browse files
committed
SILOptimizer: rename ANALYSIS macro to SIL_ANALYSIS
Avoids a conflict with clang's `ANALYSIS` macro. Fixes a macro redefinition warning.
1 parent 1f3e159 commit 096f02b

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

include/swift/SILOptimizer/Analysis/Analysis.def

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,36 @@
1717
//
1818
//===----------------------------------------------------------------------===//
1919

20-
/// ANALYSIS(NAME) This represents the name of an analysis. It is assumed that
21-
/// the actual analysis is called `NAME ## ANALYSIS'.
22-
#ifndef ANALYSIS
23-
#define ANALYSIS(NAME)
20+
/// SIL_ANALYSIS(NAME) This represents the name of an analysis. It is assumed that
21+
/// the actual analysis is called `NAME ## Analysis'.
22+
#ifndef SIL_ANALYSIS
23+
#error "SIL_ANALYSIS macro must be defined"
2424
#endif
2525

26-
ANALYSIS(AccessSummary)
27-
ANALYSIS(AccessStorage)
28-
ANALYSIS(Alias)
29-
ANALYSIS(BasicCallee)
30-
ANALYSIS(Caller)
31-
ANALYSIS(ClassHierarchy)
32-
ANALYSIS(ClosureScope)
33-
ANALYSIS(Destructor)
34-
ANALYSIS(DifferentiableActivity)
35-
ANALYSIS(Dominance)
36-
ANALYSIS(EpilogueARC)
37-
ANALYSIS(Escape)
38-
ANALYSIS(InductionVariable)
39-
ANALYSIS(Loop)
40-
ANALYSIS(LoopRegion)
41-
ANALYSIS(NonLocalAccessBlock)
42-
ANALYSIS(OptimizerStats)
43-
ANALYSIS(PostDominance)
44-
ANALYSIS(PostOrder)
45-
ANALYSIS(ProtocolConformance)
46-
ANALYSIS(RCIdentity)
47-
ANALYSIS(SideEffect)
48-
ANALYSIS(TypeExpansion)
49-
ANALYSIS(PassManagerVerifier)
50-
ANALYSIS(DeadEndBlocks)
26+
SIL_ANALYSIS(AccessSummary)
27+
SIL_ANALYSIS(AccessStorage)
28+
SIL_ANALYSIS(Alias)
29+
SIL_ANALYSIS(BasicCallee)
30+
SIL_ANALYSIS(Caller)
31+
SIL_ANALYSIS(ClassHierarchy)
32+
SIL_ANALYSIS(ClosureScope)
33+
SIL_ANALYSIS(Destructor)
34+
SIL_ANALYSIS(DifferentiableActivity)
35+
SIL_ANALYSIS(Dominance)
36+
SIL_ANALYSIS(EpilogueARC)
37+
SIL_ANALYSIS(Escape)
38+
SIL_ANALYSIS(InductionVariable)
39+
SIL_ANALYSIS(Loop)
40+
SIL_ANALYSIS(LoopRegion)
41+
SIL_ANALYSIS(NonLocalAccessBlock)
42+
SIL_ANALYSIS(OptimizerStats)
43+
SIL_ANALYSIS(PostDominance)
44+
SIL_ANALYSIS(PostOrder)
45+
SIL_ANALYSIS(ProtocolConformance)
46+
SIL_ANALYSIS(RCIdentity)
47+
SIL_ANALYSIS(SideEffect)
48+
SIL_ANALYSIS(TypeExpansion)
49+
SIL_ANALYSIS(PassManagerVerifier)
50+
SIL_ANALYSIS(DeadEndBlocks)
5151

52-
#undef ANALYSIS
52+
#undef SIL_ANALYSIS

include/swift/SILOptimizer/Analysis/Analysis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SILPassManager;
2727
/// A list of the known analysis.
2828
struct SILAnalysisKind {
2929
enum InnerTy {
30-
#define ANALYSIS(NAME) NAME,
30+
#define SIL_ANALYSIS(NAME) NAME,
3131
#include "Analysis.def"
3232
} value;
3333

@@ -334,7 +334,7 @@ class LazyFunctionInfo {
334334
FunctionInfoTy *operator->() { return *this; }
335335
};
336336

337-
#define ANALYSIS(NAME) SILAnalysis *create##NAME##Analysis(SILModule *);
337+
#define SIL_ANALYSIS(NAME) SILAnalysis *create##NAME##Analysis(SILModule *);
338338
#include "Analysis.def"
339339

340340
} // end namespace swift

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ SILPassManager::SILPassManager(SILModule *M, bool isMandatory,
327327
: Mod(M), IRMod(IRMod),
328328
swiftPassInvocation(this),
329329
isMandatory(isMandatory), deserializationNotificationHandler(nullptr) {
330-
#define ANALYSIS(NAME) \
330+
#define SIL_ANALYSIS(NAME) \
331331
Analyses.push_back(create##NAME##Analysis(Mod));
332332
#include "swift/SILOptimizer/Analysis/Analysis.def"
333333

0 commit comments

Comments
 (0)