3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-26 07:43:41 +00:00

enable tag classes

This commit is contained in:
Nikolaj Bjorner 2025-05-28 17:57:58 +01:00
parent bbb3d5379b
commit 4b2e5adc11
2 changed files with 21 additions and 20 deletions

View file

@ -57,7 +57,7 @@ void finalize_trace() {
g_enabled_trace_tags = nullptr; g_enabled_trace_tags = nullptr;
} }
const TraceTag* get_tag_classes() { static const TraceTag* get_tag_classes() {
static bool tag_class_init = false; // ignore thread safety assuming TRACE is already under a lock. static bool tag_class_init = false; // ignore thread safety assuming TRACE is already under a lock.
if (!tag_class_init) { if (!tag_class_init) {
// Arrays to track first and last tag in each class // Arrays to track first and last tag in each class
@ -91,19 +91,20 @@ const TraceTag* get_tag_classes() {
void enable_trace(const char * tag) { void enable_trace(const char * tag) {
get_enabled_trace_tags().insert(tag); get_enabled_trace_tags().insert(tag);
// TODO(#7663): Implement tag_class activation of all associated tags TraceTag tag_str = find_trace_tag_by_string(tag);
// int count = 0; if (tag_str == TraceTag::Count)
// TraceTag tag_str = find_trace_tag_by_string(tag); return;
// if(tag_str == TraceTag::Count) {
// return; auto tag_class = get_trace_tag_class(tag_str);
// } if (tag_class != tag_str)
// const TraceTag* tags = get_tags_by_class(tag_str, count); return; // Only enable the tag if it is a class tag.
// for (int i = 0; i < count; ++i) { auto const& next_tag = get_tag_classes();
// const char* tag_str = tracetag_to_string(tags[i]);
// if (!get_enabled_trace_tags().contains(tag_str)) { auto t = next_tag[static_cast<unsigned>(tag_str)];
// get_enabled_trace_tags().insert(tag_str); while (t != tag_str) {
// } get_enabled_trace_tags().insert(tracetag_to_string(t));
// } t = next_tag[static_cast<unsigned>(t)];
}
} }
void enable_all_trace(bool flag) { void enable_all_trace(bool flag) {

View file

@ -83,9 +83,9 @@ static TraceTag tag_classes[] = {
// } // }
// Find TraceTag by string // Find TraceTag by string
// inline TraceTag find_trace_tag_by_string(const char* tag_str) { inline TraceTag find_trace_tag_by_string(const char* tag_str) {
// #define X(tag, tag_class, desc) if (strncmp(#tag, tag_str, strlen(#tag)) == 0) return TraceTag::tag; #define X(tag, tag_class, desc) if (strncmp(#tag, tag_str, strlen(#tag)) == 0) return TraceTag::tag;
// include "util/trace_tags.def" #include "util/trace_tags.def"
// #undef X #undef X
// return TraceTag::Count; return TraceTag::Count;
// } }