MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / getMemberTypespec

Function getMemberTypespec

src/DesignCompile/CompileExpression.cpp:4111–4133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4109}
4110
4111const typespec *getMemberTypespec(const typespec *tpss,
4112 const std::vector<std::string> &suffixes,
4113 uint32_t index) {
4114 const typespec *result = nullptr;
4115 if (tpss == nullptr) return result;
4116 if (tpss->UhdmType() == uhdmstruct_typespec) {
4117 const struct_typespec *ts = (const struct_typespec *)tpss;
4118 for (typespec_member *memb : *ts->Members()) {
4119 if (memb->VpiName() == suffixes[index]) {
4120 if (const UHDM::ref_typespec *rt = memb->Typespec()) {
4121 result = rt->Actual_typespec();
4122 }
4123 if (result && (index < (suffixes.size() - 1))) {
4124 if (result->UhdmType() == uhdmstruct_typespec) {
4125 result = getMemberTypespec(result, suffixes, index + 1);
4126 }
4127 }
4128 break;
4129 }
4130 }
4131 }
4132 return result;
4133}
4134
4135const typespec *CompileHelper::getTypespec(DesignComponent *component,
4136 const FileContent *fC, NodeId id,

Callers 1

getTypespecMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected