diff --git a/clang/tools/CIndex/CIndexUSRs.cpp b/clang/tools/CIndex/CIndexUSRs.cpp index 549c65058d86..f9e1c23f7ae1 100644 --- a/clang/tools/CIndex/CIndexUSRs.cpp +++ b/clang/tools/CIndex/CIndexUSRs.cpp @@ -74,6 +74,7 @@ public: void VisitBlockDecl(BlockDecl *D); void VisitDeclContext(DeclContext *D); + void VisitEnumDecl(EnumDecl *D); void VisitFunctionDecl(FunctionDecl *D); void VisitNamedDecl(NamedDecl *D); void VisitNamespaceDecl(NamespaceDecl *D); @@ -96,6 +97,16 @@ void USRGenerator::VisitDeclContext(DeclContext *DC) { Visit(D); } +void USRGenerator::VisitEnumDecl(EnumDecl *D) { + VisitDeclContext(D->getDeclContext()); + Out << "@E^"; + const std::string &s = D->getNameAsString(); + if (s.empty()) + Out << "anon"; + else + Out << s; +} + void USRGenerator::VisitFunctionDecl(FunctionDecl *D) { VisitDeclContext(D->getDeclContext()); Out << "@F^" << D->getNameAsString();