aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-15 20:04:31 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-15 20:04:31 +0000
commit5467b208d5efe8c6a565e49de288b49576e3e4b3 (patch)
tree9317b5695f41110b06160e4db61ac6f96eaf8e58
parentf2c87bd0368775927ead93e0dee3e4f3ca3f9a63 (diff)
Add USR generation for enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93543 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/CIndex/CIndexUSRs.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp
index 549c65058d..f9e1c23f7a 100644
--- a/tools/CIndex/CIndexUSRs.cpp
+++ b/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();