79 TemplateSpecializationType *special_type) {
86 if (special_type->isSugared()) {
87 auto ut{special_type->desugar().getTypePtr()};
88 TraverseType(special_type->desugar());
93 auto template_name{special_type->getTemplateName()};
95 clang::LangOptions LangOpts;
96 LangOpts.CPlusPlus =
true;
97 clang::PrintingPolicy Policy(LangOpts);
99 Policy.adjustForCPlusPlus();
101 std::string name_string;
102 llvm::raw_string_ostream sstream(name_string);
103 template_name.print(sstream, Policy);
204 auto type_decl{rt->getDecl()};
205 auto type_name{type_decl->getName().str()};
220 if (
auto ctsd = dyn_cast<ClassTemplateSpecializationDecl>(type_decl)) {
223 const TemplateArgumentList &arg_list{ctsd->getTemplateArgs()};
224 for (
unsigned int i{0}; i < arg_list.size(); ++i) {
225 const TemplateArgument &targ{arg_list[i]};
232 if (targ.getKind() == TemplateArgument::ArgKind::Type) {
233 QualType template_name{targ.getAsType()};
234 const Type *arg_type{targ.getAsType().getTypePtr()};
236 if (!arg_type->isBuiltinType()) {
238 TraverseType(QualType(
239 arg_list[i].getAsType()->getUnqualifiedDesugaredType(), 1));
247 }
else if (targ.getKind() == TemplateArgument::ArgKind::Integral) {
248 QualType template_name{targ.getNonTypeTemplateArgumentType()};
259 if (template_name.getAsString() !=
"enum sc_core::sc_writer_policy") {
260 auto integral{targ.getAsIntegral()};
261 SmallString<16> integral_string{};
262 integral.toString(integral_string);
266 integral_string.c_str(), template_name.getTypePtr()})};
298 for (
auto const &node : *args) {
300 auto type_data{node->getDataPtr()};
301 auto parent_node{node->getParent()};
302 auto parent_data{parent_node->getDataPtr()};
303 if (parent_node->getDataPtr() == node->getDataPtr()) {
307 str +=
"type_name: " + type_data->getTypeName() +
": nullptr \n";
315 str +=
"parent_type_name: " + parent_data->getTypeName() +
": " + type_data->getTypeName();
319 LLVM_DEBUG(llvm::dbgs() << str; );