3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-04 12:40:23 +00:00

Centralize and document TRACE tags using X-macros (#7657)

* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros

* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md

* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled

* trace: improve trace tag handling system with hierarchical tagging

- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
  (class names and descriptions to be refined in a future update)

* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals

* trace : add cstring header

* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py

* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.

* trace : Add TODO comment for future implementation of tag_class activation

* trace : Disable code related to tag_class until implementation is ready (#7663).
This commit is contained in:
LeeYoungJoon 2025-05-28 22:31:25 +09:00 committed by GitHub
parent d766292dab
commit 0a93ff515d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
583 changed files with 8698 additions and 7299 deletions

View file

@ -49,14 +49,14 @@ static void tst1() {
m.mk(a1);
ENSURE(m.size(a1) == 0);
m.push_back(a1, 10, a2);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
ENSURE(m.size(a1) == 0);
ENSURE(m.size(a2) == 1);
m.push_back(a1, 20, a1);
m.push_back(a1, 30, a1);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
ENSURE(m.get(a1, 0) == 20);
@ -69,7 +69,7 @@ static void tst1() {
ENSURE(m.size(a3) == 2);
ENSURE(m.get(a3, 0) == 10);
ENSURE(m.get(a3, 1) == 100);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
m.display_info(tout, a3); tout << "\n";);
@ -77,7 +77,7 @@ static void tst1() {
ENSURE(m.get(a2, 0) == 10);
ENSURE(m.get(a2, 1) == 50);
ENSURE(m.size(a2) == 2);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
m.display_info(tout, a3); tout << "\n";);
@ -91,7 +91,7 @@ static void tst2() {
typedef parray_manager<int_parray_config<PRESERVE_ROOTS> > int_parray_manager;
typedef typename int_parray_manager::ref int_array;
TRACE("parray", tout << "tst2\n";);
TRACE(parray, tout << "tst2\n";);
dummy_value_manager<int> vm;
small_object_allocator a;
int_parray_manager m(vm, a);
@ -105,11 +105,11 @@ static void tst2() {
m.push_back(a1, 100, a2);
for (unsigned i = 0; i < 10; i++)
m.push_back(a2, i+101);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
ENSURE(m.get(a1, 0) == 0);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
for (unsigned i = 0; i < m.size(a1); i++) {
@ -118,11 +118,11 @@ static void tst2() {
for (unsigned i = 0; i < m.size(a2); i++) {
ENSURE(static_cast<unsigned>(m.get(a2, i)) == i);
}
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
m.unshare(a1);
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";);
m.del(a1);
@ -134,7 +134,7 @@ static void tst3() {
typedef parray_manager<int_parray_config<PRESERVE_ROOTS> > int_parray_manager;
typedef typename int_parray_manager::ref int_array;
TRACE("parray", tout << "tst3\n";);
TRACE(parray, tout << "tst3\n";);
dummy_value_manager<int> vm;
small_object_allocator a;
int_parray_manager m(vm, a);
@ -164,14 +164,14 @@ static void tst3() {
for (unsigned i = 0; i < 20; i++) {
ENSURE(static_cast<unsigned>(m.get(a2, i)) == i+1);
}
TRACE("parray",
TRACE(parray,
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
m.display_info(tout, a3); tout << "\n";
m.display_info(tout, a4); tout << "\n";
);
ENSURE(m.get(a1, 10) == 10);
TRACE("parray",
TRACE(parray,
tout << "after rerooting...\n";
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
@ -191,7 +191,7 @@ static void tst3() {
}
ENSURE(m.get(a4, 18) == 30);
ENSURE(m.get(a3, 18) == 40);
TRACE("parray",
TRACE(parray,
tout << "after many gets...\n";
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
@ -199,7 +199,7 @@ static void tst3() {
m.display_info(tout, a4); tout << "\n";
);
m.unshare(a1);
TRACE("parray",
TRACE(parray,
tout << "after unshare...\n";
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
@ -207,7 +207,7 @@ static void tst3() {
m.display_info(tout, a4); tout << "\n";
);
m.reroot(a4);
TRACE("parray",
TRACE(parray,
tout << "after reroot...\n";
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
@ -215,7 +215,7 @@ static void tst3() {
m.display_info(tout, a4); tout << "\n";
);
m.unshare(a2);
TRACE("parray",
TRACE(parray,
tout << "after second unshare...\n";
m.display_info(tout, a1); tout << "\n";
m.display_info(tout, a2); tout << "\n";
@ -244,7 +244,7 @@ typedef parray_manager<expr_array_config> expr_array_manager;
typedef expr_array_manager::ref expr_array;
static void tst4() {
TRACE("parray", tout << "tst4\n";);
TRACE(parray, tout << "tst4\n";);
ast_manager m;
expr_array_manager m2(m, m.get_allocator());
@ -262,12 +262,12 @@ static void tst4() {
m2.push_back(a1, v3);
m2.push_back(a2, v2);
m2.pop_back(a1);
TRACE("parray",
TRACE(parray,
m2.display_info(tout, a1); tout << "\n";
m2.display_info(tout, a2); tout << "\n";
);
m2.reroot(a1);
TRACE("parray",
TRACE(parray,
m2.display_info(tout, a1); tout << "\n";
m2.display_info(tout, a2); tout << "\n";
);