[llvm] Introduce LDBG_OS() macro as a variant of LDBG() (PR #157194)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 06:32:52 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/include/llvm/Support/Debug.h llvm/include/llvm/Support/DebugLog.h llvm/unittests/Support/DebugLogTest.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Support/DebugLog.h b/llvm/include/llvm/Support/DebugLog.h
index 3f90ba952..5d3e94295 100644
--- a/llvm/include/llvm/Support/DebugLog.h
+++ b/llvm/include/llvm/Support/DebugLog.h
@@ -109,7 +109,7 @@ namespace llvm {
/// defined. They use a combination of preprocessor tricks and C++11
/// user-defined string literals to achieve this.
/// For example, if DEBUG_TYPE is defined to "foo", the preprocessor will expand
-/// the macro and then stringify the result to:
+/// the macro and then stringify the result to:
/// * "foo"_LDBG_VARIABLE_CHECK
/// This dispatches to the user-defined string literal operator named
/// _LDBG_VARIABLE_CHECK which returns true. Otherwise it expands to
@@ -151,9 +151,9 @@ constexpr ::llvm::StringRef operator""_LDBG_DEBUG_STRING(const char *Str,
}
/// Helper to provide the default level (=1) or type (=DEBUG_TYPE). This is used
-/// when a single argument is passed to LDBG() (or LDBG_OS()), if it is an integer we return DEBUG_TYPE
-/// and if it is a string we return 1. This fails with a static_assert if we
-/// pass an integer and DEBUG_TYPE is not defined.
+/// when a single argument is passed to LDBG() (or LDBG_OS()), if it is an
+/// integer we return DEBUG_TYPE and if it is a string we return 1. This fails
+/// with a static_assert if we pass an integer and DEBUG_TYPE is not defined.
#define LDBG_GET_DEFAULT_TYPE_OR_LEVEL(LEVEL_OR_TYPE) \
[](auto LevelOrType) { \
if constexpr (std::is_integral_v<decltype(LevelOrType)>) { \
``````````
</details>
https://github.com/llvm/llvm-project/pull/157194
More information about the llvm-commits
mailing list