From 17d45796a688b5a48caee40c76c7b8af69a8e031 Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Wed, 15 Jan 2025 15:25:35 +0100 Subject: [PATCH] ModuleHdlnameIndex: handle objects with private name and hdlname attribute --- kernel/scopeinfo.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/scopeinfo.h b/kernel/scopeinfo.h index 703dc315f..45d867b62 100644 --- a/kernel/scopeinfo.h +++ b/kernel/scopeinfo.h @@ -337,12 +337,12 @@ template std::vector parse_hdlname(const O* object) { std::vector path; - if (!object->name.isPublic()) - return path; for (auto const &item : object->get_hdlname_attribute()) path.push_back("\\" + item); - if (path.empty()) + if (path.empty() && object->name.isPublic()) path.push_back(object->name); + if (!path.empty() && !(object->name.isPublic() || object->name.begins_with("$paramod") || object->name.begins_with("$abstract"))) + path.pop_back(); return path; } @@ -351,17 +351,22 @@ std::pair, IdString> parse_scopename(const O* object) { std::vector path; IdString trailing = object->name; - if (object->name.isPublic()) { + if (object->name.isPublic() || object->name.begins_with("$paramod") || object->name.begins_with("$abstract")) { for (auto const &item : object->get_hdlname_attribute()) path.push_back("\\" + item); if (!path.empty()) { trailing = path.back(); path.pop_back(); } + } else if (object->has_attribute(ID::hdlname)) { + for (auto const &item : object->get_hdlname_attribute()) + path.push_back("\\" + item); + if (!path.empty()) { + path.pop_back(); + } } else { for (auto const &item : split_tokens(object->get_string_attribute(ID(scopename)), " ")) path.push_back("\\" + item); - } return {path, trailing}; }