From 7b86d5c6c3384bf3899ccc25a7b7a1db8ecc6b01 Mon Sep 17 00:00:00 2001 From: Kolya Panchenko Date: Mon, 17 Mar 2025 12:27:21 -0400 Subject: [PATCH] [JSON][NFC] Move print method out of NDEBUG || DUMP --- llvm/include/llvm/Support/JSON.h | 2 +- llvm/lib/Support/JSON.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h index 3e3f783ffb857..7f7f5f6228763 100644 --- a/llvm/include/llvm/Support/JSON.h +++ b/llvm/include/llvm/Support/JSON.h @@ -472,8 +472,8 @@ class Value { return LLVM_LIKELY(Type == T_Array) ? &as() : nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) void print(llvm::raw_ostream &OS) const; +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void dump() const { print(llvm::dbgs()); llvm::dbgs() << '\n'; diff --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp index 98fef5dcf68a3..e7b762f550d46 100644 --- a/llvm/lib/Support/JSON.cpp +++ b/llvm/lib/Support/JSON.cpp @@ -182,9 +182,7 @@ void Value::destroy() { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) void Value::print(llvm::raw_ostream &OS) const { OS << *this; } -#endif // !NDEBUG || LLVM_ENABLE_DUMP bool operator==(const Value &L, const Value &R) { if (L.kind() != R.kind())