Skip to content

Commit 92eaf03

Browse files
authored
[NFC][RemoveDIs] Remove conditional compilation for RemoveDIs (#81149)
A colleague observes that switching the default value of LLVM_EXPERIMENTAL_DEBUGINFO_ITERATORS to "On" hasn't flipped the value in their CMakeCache.txt. This probably means that everyone with an existing build tree is going to not have support built in, meaning everyone in LLVM would need to clean+rebuild their worktree when we flip the switch on... which doesn't sound good. So instead, just delete the flag and everything it does, making everyone build and run ~400 lit tests in RemoveDIs mode. None of the buildbots have had trouble with this, so it Should Be Fine (TM). (Sending for review as this is changing various comments, and touches several different areas -- I don't want to get too punchy).
1 parent 067d277 commit 92eaf03

File tree

11 files changed

+14
-88
lines changed

11 files changed

+14
-88
lines changed

llvm/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,6 @@ option(LLVM_USE_OPROFILE
653653
option(LLVM_EXTERNALIZE_DEBUGINFO
654654
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
655655

656-
option(LLVM_EXPERIMENTAL_DEBUGINFO_ITERATORS
657-
"Add extra Booleans to ilist_iterators to communicate facts for debug-info" ON)
658-
659656
set(LLVM_CODESIGNING_IDENTITY "" CACHE STRING
660657
"Sign executables and dylibs with the given identity or skip if empty (Darwin Only)")
661658

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ if(LLVM_ENABLE_EXPENSIVE_CHECKS)
140140
endif()
141141
endif()
142142

143-
if(LLVM_EXPERIMENTAL_DEBUGINFO_ITERATORS)
144-
add_compile_definitions(EXPERIMENTAL_DEBUGINFO_ITERATORS)
145-
endif()
146-
147143
if (LLVM_ENABLE_STRICT_FIXED_SIZE_VECTORS)
148144
add_compile_definitions(STRICT_FIXED_SIZE_VECTORS)
149145
endif()

llvm/include/llvm/ADT/ilist_iterator.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,12 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
202202

203203
node_pointer NodePtr = nullptr;
204204

205-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
206-
// (Default: Off) Allow extra position-information flags to be stored
207-
// in iterators, in aid of removing debug-info intrinsics from LLVM.
208-
209205
/// Is this position intended to contain any debug-info immediately before
210206
/// the position?
211207
mutable bool HeadInclusiveBit = false;
212208
/// Is this position intended to contain any debug-info immediately after
213209
/// the position?
214210
mutable bool TailInclusiveBit = false;
215-
#endif
216211

217212
public:
218213
/// Create from an ilist_node.
@@ -231,10 +226,8 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
231226
const ilist_iterator_w_bits<OptionsT, IsReverse, RHSIsConst> &RHS,
232227
std::enable_if_t<IsConst || !RHSIsConst, void *> = nullptr)
233228
: NodePtr(RHS.NodePtr) {
234-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
235229
HeadInclusiveBit = RHS.HeadInclusiveBit;
236230
TailInclusiveBit = RHS.TailInclusiveBit;
237-
#endif
238231
}
239232

240233
// This is templated so that we can allow assigning to a const iterator from
@@ -243,10 +236,8 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
243236
std::enable_if_t<IsConst || !RHSIsConst, ilist_iterator_w_bits &>
244237
operator=(const ilist_iterator_w_bits<OptionsT, IsReverse, RHSIsConst> &RHS) {
245238
NodePtr = RHS.NodePtr;
246-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
247239
HeadInclusiveBit = RHS.HeadInclusiveBit;
248240
TailInclusiveBit = RHS.TailInclusiveBit;
249-
#endif
250241
return *this;
251242
}
252243

@@ -280,10 +271,8 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
280271
const_cast<typename ilist_iterator_w_bits<OptionsT, IsReverse,
281272
false>::node_reference>(
282273
*NodePtr));
283-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
284274
New.HeadInclusiveBit = HeadInclusiveBit;
285275
New.TailInclusiveBit = TailInclusiveBit;
286-
#endif
287276
return New;
288277
}
289278
return ilist_iterator_w_bits<OptionsT, IsReverse, false>();
@@ -309,18 +298,14 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
309298
// Increment and decrement operators...
310299
ilist_iterator_w_bits &operator--() {
311300
NodePtr = IsReverse ? NodePtr->getNext() : NodePtr->getPrev();
312-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
313301
HeadInclusiveBit = false;
314302
TailInclusiveBit = false;
315-
#endif
316303
return *this;
317304
}
318305
ilist_iterator_w_bits &operator++() {
319306
NodePtr = IsReverse ? NodePtr->getPrev() : NodePtr->getNext();
320-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
321307
HeadInclusiveBit = false;
322308
TailInclusiveBit = false;
323-
#endif
324309
return *this;
325310
}
326311
ilist_iterator_w_bits operator--(int) {
@@ -340,18 +325,10 @@ class ilist_iterator_w_bits : ilist_detail::SpecificNodeAccess<OptionsT> {
340325
/// Check for end. Only valid if ilist_sentinel_tracking<true>.
341326
bool isEnd() const { return NodePtr ? NodePtr->isSentinel() : false; }
342327

343-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
344328
bool getHeadBit() const { return HeadInclusiveBit; }
345329
bool getTailBit() const { return TailInclusiveBit; }
346330
void setHeadBit(bool SetBit) const { HeadInclusiveBit = SetBit; }
347331
void setTailBit(bool SetBit) const { TailInclusiveBit = SetBit; }
348-
#else
349-
// Store and return no information if we're not using this feature.
350-
bool getHeadBit() const { return false; }
351-
bool getTailBit() const { return false; }
352-
void setHeadBit(bool SetBit) const { (void)SetBit; }
353-
void setTailBit(bool SetBit) const { (void)SetBit; }
354-
#endif
355332
};
356333

357334
template <typename From> struct simplify_type;

llvm/tools/llc/llc.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,11 @@ int main(int argc, char **argv) {
365365
}
366366

367367
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
368-
// new debug-info format, if it's built in.
369-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
368+
// new debug-info format.
370369
if (TryUseNewDbgInfoFormat) {
371-
// If LLVM was built with support for this, turn the new debug-info format
372-
// on.
370+
// Turn the new debug-info format on.
373371
UseNewDbgInfoFormat = true;
374372
}
375-
#endif
376-
(void)TryUseNewDbgInfoFormat;
377373

378374
if (TimeTrace)
379375
timeTraceProfilerInitialize(TimeTraceGranularity, argv[0]);

llvm/tools/llvm-link/llvm-link.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,11 @@ int main(int argc, char **argv) {
473473
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
474474

475475
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
476-
// new debug-info format, if it's built in.
477-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
476+
// new debug-info format.
478477
if (TryUseNewDbgInfoFormat) {
479-
// If LLVM was built with support for this, turn the new debug-info format
480-
// on.
478+
// Turn the new debug-info format on.
481479
UseNewDbgInfoFormat = true;
482480
}
483-
#endif
484-
(void)TryUseNewDbgInfoFormat;
485481

486482
LLVMContext Context;
487483
Context.setDiagnosticHandler(std::make_unique<LLVMLinkDiagnosticHandler>(),

llvm/tools/llvm-lto/llvm-lto.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -945,15 +945,11 @@ int main(int argc, char **argv) {
945945
cl::ParseCommandLineOptions(argc, argv, "llvm LTO linker\n");
946946

947947
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
948-
// new debug-info format, if it's built in.
949-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
948+
// new debug-info format.
950949
if (TryUseNewDbgInfoFormat) {
951-
// If LLVM was built with support for this, turn the new debug-info format
952-
// on.
950+
// Turn the new debug-info format on.
953951
UseNewDbgInfoFormat = true;
954952
}
955-
#endif
956-
(void)TryUseNewDbgInfoFormat;
957953

958954
if (OptLevel < '0' || OptLevel > '3')
959955
error("optimization level must be between 0 and 3");

llvm/tools/llvm-lto2/llvm-lto2.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,11 @@ static int run(int argc, char **argv) {
230230
cl::ParseCommandLineOptions(argc, argv, "Resolution-based LTO test harness");
231231

232232
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
233-
// new debug-info format, if it's built in.
234-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
233+
// new debug-info format.
235234
if (TryUseNewDbgInfoFormat) {
236-
// If LLVM was built with support for this, turn the new debug-info format
237-
// on.
235+
// Turn the new debug-info format on.
238236
UseNewDbgInfoFormat = true;
239237
}
240-
#endif
241-
(void)TryUseNewDbgInfoFormat;
242238

243239
// FIXME: Workaround PR30396 which means that a symbol can appear
244240
// more than once if it is defined in module-level assembly and

llvm/tools/llvm-reduce/llvm-reduce.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,11 @@ int main(int Argc, char **Argv) {
151151
cl::ParseCommandLineOptions(Argc, Argv, "LLVM automatic testcase reducer.\n");
152152

153153
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
154-
// new debug-info format, if it's built in.
155-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
154+
// new debug-info format.
156155
if (TryUseNewDbgInfoFormat) {
157-
// If LLVM was built with support for this, turn the new debug-info format
158-
// on.
156+
// Turn the new debug-info format on.
159157
UseNewDbgInfoFormat = true;
160158
}
161-
#endif
162-
(void)TryUseNewDbgInfoFormat;
163159

164160
if (Argc == 1) {
165161
cl::PrintHelpMessage();

llvm/tools/opt/optdriver.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,15 +462,11 @@ extern "C" int optMain(
462462
argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n");
463463

464464
// RemoveDIs debug-info transition: tests may request that we /try/ to use the
465-
// new debug-info format, if it's built in.
466-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
465+
// new debug-info format.
467466
if (TryUseNewDbgInfoFormat) {
468-
// If LLVM was built with support for this, turn the new debug-info format
469-
// on.
467+
// Turn the new debug-info format on.
470468
UseNewDbgInfoFormat = true;
471469
}
472-
#endif
473-
(void)TryUseNewDbgInfoFormat;
474470

475471
LLVMContext Context;
476472

llvm/unittests/ADT/IListIteratorBitsTest.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ TEST(IListIteratorBitsTest, ConsAndAssignment) {
5555

5656
simple_ilist<Node, ilist_iterator_bits<true>>::iterator I, I2;
5757

58-
// Two sets of tests: if we've compiled in the iterator bits, then check that
59-
// HeadInclusiveBit and TailInclusiveBit are preserved on assignment and copy
60-
// construction, but not on other operations.
61-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
58+
// Check that HeadInclusiveBit and TailInclusiveBit are preserved on
59+
// assignment and copy construction, but not on other operations.
6260
I = L.begin();
6361
EXPECT_FALSE(I.getHeadBit());
6462
EXPECT_FALSE(I.getTailBit());
@@ -85,18 +83,6 @@ TEST(IListIteratorBitsTest, ConsAndAssignment) {
8583
simple_ilist<Node, ilist_iterator_bits<true>>::iterator I3(I);
8684
EXPECT_TRUE(I3.getHeadBit());
8785
EXPECT_TRUE(I3.getTailBit());
88-
#else
89-
// The calls should be available, but shouldn't actually store information.
90-
I = L.begin();
91-
EXPECT_FALSE(I.getHeadBit());
92-
EXPECT_FALSE(I.getTailBit());
93-
I.setHeadBit(true);
94-
I.setTailBit(true);
95-
EXPECT_FALSE(I.getHeadBit());
96-
EXPECT_FALSE(I.getTailBit());
97-
// Suppress warnings as we don't test with this variable.
98-
(void)I2;
99-
#endif
10086
}
10187

10288
class dummy {

llvm/unittests/IR/BasicBlockDbgInfoTest.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ using namespace llvm;
2727

2828
extern cl::opt<bool> UseNewDbgInfoFormat;
2929

30-
// None of these tests are meaningful or do anything if we do not have the
31-
// experimental "head" bit compiled into ilist_iterator (aka
32-
// ilist_iterator_w_bits), thus there's no point compiling these tests in.
33-
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
34-
3530
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
3631
SMDiagnostic Err;
3732
std::unique_ptr<Module> Mod = parseAssemblyString(IR, Err, C);
@@ -1535,4 +1530,3 @@ TEST(BasicBlockDbgInfoTest, DbgMoveToEnd) {
15351530
}
15361531

15371532
} // End anonymous namespace.
1538-
#endif // EXPERIMENTAL_DEBUGINFO_ITERATORS

0 commit comments

Comments
 (0)