diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2025-07-28 18:10:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-28 18:10:36 +0200 |
commit | 9c82f87aec12c77444edf04d46af4d8405becc25 (patch) | |
tree | e93d2921a5a29de81fbbbfad5a859e6e0a4c7639 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | b2322772f2ab97de60db906a591353a5ef77cdfe (diff) | |
download | llvm-9c82f87aec12c77444edf04d46af4d8405becc25.zip llvm-9c82f87aec12c77444edf04d46af4d8405becc25.tar.gz llvm-9c82f87aec12c77444edf04d46af4d8405becc25.tar.bz2 |
Introduce a "log level" support for DEBUG_TYPE (#150855)
This allows to set an optional integer level for a given debug type. The
string format is `type[:level]`, and the integer is interpreted as such:
- if not provided: all debugging for this debug type is enabled.
- if >0: all debug that is < to the level is enabled.
- if 0: same as for >0 but also does not disable the other debug-types,
it acts as a negative filter.
The LDBG() macro is updated to accept an optional log level to
illustrate the feature. Here is the expected behavior:
LDBG() << "A"; // Identical to LDBG(1) << "A";
LDBG(2) << "B";
With `--debug-only=some_type`: we'll see A and B in the output.
With `--debug-only=some_type:1`: we'll see A but not B in the output.
With `--debug-only=some_type:2`: we'll see A and B in the output. (same
with any level above 2)
With `--debug-only=some_type:0`: we'll see neither A nor B in the
output, but we'll see any other logging for other debug types.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions