Skip to content

Commit 17d4579

Browse files
committed
ModuleHdlnameIndex: handle objects with private name and hdlname attribute
1 parent eac2294 commit 17d4579

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

kernel/scopeinfo.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,12 @@ template<typename O>
337337
std::vector<IdString> parse_hdlname(const O* object)
338338
{
339339
std::vector<IdString> path;
340-
if (!object->name.isPublic())
341-
return path;
342340
for (auto const &item : object->get_hdlname_attribute())
343341
path.push_back("\\" + item);
344-
if (path.empty())
342+
if (path.empty() && object->name.isPublic())
345343
path.push_back(object->name);
344+
if (!path.empty() && !(object->name.isPublic() || object->name.begins_with("$paramod") || object->name.begins_with("$abstract")))
345+
path.pop_back();
346346
return path;
347347
}
348348

@@ -351,17 +351,22 @@ std::pair<std::vector<IdString>, IdString> parse_scopename(const O* object)
351351
{
352352
std::vector<IdString> path;
353353
IdString trailing = object->name;
354-
if (object->name.isPublic()) {
354+
if (object->name.isPublic() || object->name.begins_with("$paramod") || object->name.begins_with("$abstract")) {
355355
for (auto const &item : object->get_hdlname_attribute())
356356
path.push_back("\\" + item);
357357
if (!path.empty()) {
358358
trailing = path.back();
359359
path.pop_back();
360360
}
361+
} else if (object->has_attribute(ID::hdlname)) {
362+
for (auto const &item : object->get_hdlname_attribute())
363+
path.push_back("\\" + item);
364+
if (!path.empty()) {
365+
path.pop_back();
366+
}
361367
} else {
362368
for (auto const &item : split_tokens(object->get_string_attribute(ID(scopename)), " "))
363369
path.push_back("\\" + item);
364-
365370
}
366371
return {path, trailing};
367372
}

0 commit comments

Comments
 (0)