Skip to content

Commit 291b415

Browse files
authored
[Misc] Use LLVM_ENABLE_ABI_BREAKING_CHECKS correctly (#94212)
`LLVM_ENABLE_ABI_BREAKING_CHECKS` is always defined: https://github.com/llvm/llvm-project/blob/72c901f5e59477e568b1b04dae9de753b9d1f6f3/llvm/include/llvm/Config/abi-breaking.h.cmake#L16C2-L16C15 It uses `cmakedefine01` rather than `cmakedefine`, so `LLVM_ENABLE_ABI_BREAKING_CHECKS` is always defined, so the preprocessed code is probably not what the author wanted.
1 parent 21396be commit 291b415

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

llvm/include/llvm/Passes/StandardInstrumentations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class PreservedCFGCheckerInstrumentation {
171171
FunctionAnalysisManager::Invalidator &);
172172
};
173173

174-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
174+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
175175
SmallVector<StringRef, 8> PassStack;
176176
#endif
177177

llvm/include/llvm/Support/GenericDomTreeConstruction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ struct SemiNCAInfo {
638638
Bucket;
639639
SmallDenseSet<TreeNodePtr, 8> Visited;
640640
SmallVector<TreeNodePtr, 8> Affected;
641-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
641+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
642642
SmallVector<TreeNodePtr, 8> VisitedUnaffected;
643643
#endif
644644
};
@@ -913,7 +913,7 @@ struct SemiNCAInfo {
913913
LLVM_DEBUG(dbgs() << "Deleting edge " << BlockNamePrinter(From) << " -> "
914914
<< BlockNamePrinter(To) << "\n");
915915

916-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
916+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
917917
// Ensure that the edge was in fact deleted from the CFG before informing
918918
// the DomTree about it.
919919
// The check is O(N), so run it only in debug configuration.

llvm/include/llvm/Transforms/Scalar/JumpThreading.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> {
8888
std::optional<BranchProbabilityInfo *> BPI;
8989
bool ChangedSinceLastAnalysisUpdate = false;
9090
bool HasGuards = false;
91-
#ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS
91+
#if !LLVM_ENABLE_ABI_BREAKING_CHECKS
9292
SmallPtrSet<const BasicBlock *, 16> LoopHeaders;
9393
#else
9494
SmallSet<AssertingVH<const BasicBlock>, 16> LoopHeaders;

llvm/include/llvm/Transforms/Scalar/LoopPassManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class LPMUpdater {
286286
}
287287

288288
void setParentLoop(Loop *L) {
289-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
289+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
290290
ParentL = L;
291291
#endif
292292
}
@@ -377,7 +377,7 @@ class LPMUpdater {
377377
const bool LoopNestMode;
378378
bool LoopNestChanged;
379379

380-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
380+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
381381
// In debug builds we also track the parent loop to implement asserts even in
382382
// the face of loop deletion.
383383
Loop *ParentL;

llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
167167
/// consistent when instructions are moved.
168168
SmallVector<SCEVInsertPointGuard *, 8> InsertPointGuards;
169169

170-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
170+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
171171
const char *DebugType;
172172
#endif
173173

@@ -183,7 +183,7 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
183183
Builder(se.getContext(), InstSimplifyFolder(DL),
184184
IRBuilderCallbackInserter(
185185
[this](Instruction *I) { rememberInstruction(I); })) {
186-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
186+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
187187
DebugType = "";
188188
#endif
189189
}
@@ -193,7 +193,7 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
193193
assert(InsertPointGuards.empty());
194194
}
195195

196-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
196+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
197197
void setDebugType(const char *s) { DebugType = s; }
198198
#endif
199199

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ void PreservedCFGCheckerInstrumentation::registerCallbacks(
13571357
bool Registered = false;
13581358
PIC.registerBeforeNonSkippedPassCallback([this, &MAM, Registered](
13591359
StringRef P, Any IR) mutable {
1360-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
1360+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
13611361
assert(&PassStack.emplace_back(P));
13621362
#endif
13631363
(void)this;
@@ -1386,7 +1386,7 @@ void PreservedCFGCheckerInstrumentation::registerCallbacks(
13861386

13871387
PIC.registerAfterPassInvalidatedCallback(
13881388
[this](StringRef P, const PreservedAnalyses &PassPA) {
1389-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
1389+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
13901390
assert(PassStack.pop_back_val() == P &&
13911391
"Before and After callbacks must correspond");
13921392
#endif
@@ -1395,7 +1395,7 @@ void PreservedCFGCheckerInstrumentation::registerCallbacks(
13951395

13961396
PIC.registerAfterPassCallback([this, &MAM](StringRef P, Any IR,
13971397
const PreservedAnalyses &PassPA) {
1398-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
1398+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
13991399
assert(PassStack.pop_back_val() == P &&
14001400
"Before and After callbacks must correspond");
14011401
#endif

llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "llvm/Support/raw_ostream.h"
2929
#include "llvm/Transforms/Utils/LoopUtils.h"
3030

31-
#ifdef LLVM_ENABLE_ABI_BREAKING_CHECKS
31+
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
3232
#define SCEV_DEBUG_WITH_TYPE(TYPE, X) DEBUG_WITH_TYPE(TYPE, X)
3333
#else
3434
#define SCEV_DEBUG_WITH_TYPE(TYPE, X)

0 commit comments

Comments
 (0)