File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -562,6 +562,17 @@ std::string normalizeTranslationRule(std::string rule) {
562562 return rule;
563563}
564564
565+ static std::string synthesizeAnonRecordName (const clang::RecordDecl *record) {
566+ std::string parent_name;
567+ if (auto *parent =
568+ clang::dyn_cast<clang::RecordDecl>(record->getDeclContext ())) {
569+ parent_name = parent->getIdentifier ()
570+ ? parent->getIdentifier ()->getName ().str ()
571+ : synthesizeAnonRecordName (parent);
572+ }
573+ return std::format (" {}_anon_{}" , parent_name, GetAnonIndex (record));
574+ }
575+
565576} // namespace
566577
567578PushASTContext::PushASTContext (clang::ASTContext &ctx) : prev_(ctx_) {
@@ -723,17 +734,6 @@ std::string ToString(clang::QualType qual_type) {
723734 return normalizeTranslationRule (type);
724735}
725736
726- static std::string synthesizeAnonRecordName (const clang::RecordDecl *record) {
727- std::string parent_name;
728- if (auto *parent =
729- clang::dyn_cast<clang::RecordDecl>(record->getDeclContext ())) {
730- parent_name = parent->getIdentifier ()
731- ? parent->getIdentifier ()->getName ().str ()
732- : synthesizeAnonRecordName (parent);
733- }
734- return std::format (" {}_anon_{}" , parent_name, GetAnonIndex (record));
735- }
736-
737737std::string ToString (const clang::NamedDecl *decl) {
738738 if (auto *record = clang::dyn_cast<clang::RecordDecl>(decl);
739739 record && !record->getIdentifier ()) {
You can’t perform that action at this time.
0 commit comments