Skip to content

Commit 9a0e1c7

Browse files
authored
Revert "[llvm] properly guard dump methods in Support lib classes" (#139927)
Reverts #139804
1 parent ba23eed commit 9a0e1c7

21 files changed

+22
-86
lines changed

llvm/include/llvm/ADT/APFixedPoint.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ class APFixedPoint {
249249
}
250250

251251
void print(raw_ostream &) const;
252-
253-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
254-
LLVM_DUMP_METHOD void dump() const;
255-
#endif
252+
void dump() const;
256253

257254
// If LHS > RHS, return 1. If LHS == RHS, return 0. If LHS < RHS, return -1.
258255
int compare(const APFixedPoint &Other) const;

llvm/include/llvm/ADT/APFloat.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,10 +1483,7 @@ class APFloat : public APFloatBase {
14831483
}
14841484

14851485
void print(raw_ostream &) const;
1486-
1487-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
1488-
LLVM_DUMP_METHOD void dump() const;
1489-
#endif
1486+
void dump() const;
14901487

14911488
bool getExactInverse(APFloat *inv) const {
14921489
APFLOAT_DISPATCH_ON_SEMANTICS(getExactInverse(inv));

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,10 +1896,8 @@ class [[nodiscard]] APInt {
18961896
/// FoldingSets.
18971897
void Profile(FoldingSetNodeID &id) const;
18981898

1899-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
19001899
/// debug method
1901-
LLVM_DUMP_METHOD void dump() const;
1902-
#endif
1900+
void dump() const;
19031901

19041902
/// Returns whether this instance allocated memory.
19051903
bool needsCleanup() const { return !isSingleWord(); }

llvm/include/llvm/ADT/DynamicAPInt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ class DynamicAPInt {
216216
void static_assert_layout(); // NOLINT
217217

218218
raw_ostream &print(raw_ostream &OS) const;
219-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
220219
LLVM_DUMP_METHOD void dump() const;
221-
#endif
222220
};
223221

224222
inline raw_ostream &operator<<(raw_ostream &OS, const DynamicAPInt &X) {

llvm/include/llvm/ADT/SlowDynamicAPInt.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ class SlowDynamicAPInt {
7979
unsigned getBitWidth() const { return Val.getBitWidth(); }
8080

8181
void print(raw_ostream &OS) const;
82-
83-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
8482
LLVM_DUMP_METHOD void dump() const;
85-
#endif
8683
};
8784

8885
inline raw_ostream &operator<<(raw_ostream &OS, const SlowDynamicAPInt &X) {

llvm/include/llvm/ADT/TrieRawHashMap.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ class ThreadSafeTrieRawHashMapBase {
9090
static void *operator new(size_t Size) { return ::operator new(Size); }
9191
void operator delete(void *Ptr) { ::operator delete(Ptr); }
9292

93-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
9493
LLVM_DUMP_METHOD void dump() const;
95-
#endif
96-
9794
void print(raw_ostream &OS) const;
9895

9996
protected:
@@ -217,10 +214,7 @@ class ThreadSafeTrieRawHashMap : public ThreadSafeTrieRawHashMapBase {
217214
using ThreadSafeTrieRawHashMapBase::operator delete;
218215
using HashType = HashT;
219216

220-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
221217
using ThreadSafeTrieRawHashMapBase::dump;
222-
#endif
223-
224218
using ThreadSafeTrieRawHashMapBase::print;
225219

226220
private:

llvm/include/llvm/ADT/Twine.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,16 +507,14 @@ namespace llvm {
507507
/// stream \p OS.
508508
void print(raw_ostream &OS) const;
509509

510+
/// Dump the concatenated string represented by this twine to stderr.
511+
void dump() const;
512+
510513
/// Write the representation of this twine to the stream \p OS.
511514
void printRepr(raw_ostream &OS) const;
512515

513-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
514-
/// Dump the concatenated string represented by this twine to stderr.
515-
LLVM_DUMP_METHOD void dump() const;
516-
517516
/// Dump the representation of this twine to stderr.
518-
LLVM_DUMP_METHOD void dumpRepr() const;
519-
#endif
517+
void dumpRepr() const;
520518

521519
/// @}
522520
};

llvm/include/llvm/Support/BalancedPartitioning.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ class BPFunctionNode {
6868
/// The ID of this node
6969
IDT Id;
7070

71-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
72-
LLVM_DUMP_METHOD void dump(raw_ostream &OS) const;
73-
#endif
71+
LLVM_ABI void dump(raw_ostream &OS) const;
7472

7573
protected:
7674
/// The list of utility nodes associated with this node

llvm/include/llvm/Support/BranchProbability.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ class BranchProbability {
7777

7878
LLVM_ABI raw_ostream &print(raw_ostream &OS) const;
7979

80-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
81-
LLVM_DUMP_METHOD void dump() const;
82-
#endif
80+
LLVM_ABI void dump() const;
8381

8482
/// Scale a large integer.
8583
///

llvm/include/llvm/Support/DebugCounter.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ class DebugCounter {
119119
Counter.CurrChunkIdx = State.ChunkIdx;
120120
}
121121

122-
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
123122
// Dump or print the current counter set into llvm::dbgs().
124-
LLVM_DUMP_METHOD void dump() const;
125-
#endif
123+
LLVM_ABI LLVM_DUMP_METHOD void dump() const;
126124

127125
LLVM_ABI void print(raw_ostream &OS) const;
128126

0 commit comments

Comments
 (0)