diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-10 17:43:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-10 17:43:18 +0000 |
commit | 4bd98e886012817fcfd40aa4c8329fa48f69b0a9 (patch) | |
tree | 3f4c332b87b5f4bf6f1bf0fdec327f06babc49ee /lib/Frontend/DocumentXML.cpp | |
parent | c896ea80bb7289a3f7eef57d3acdcd445b6851db (diff) |
Improved -ast-print-xml for C++, from Sebastien Binet!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/DocumentXML.cpp')
-rw-r--r-- | lib/Frontend/DocumentXML.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Frontend/DocumentXML.cpp b/lib/Frontend/DocumentXML.cpp index 0263c30bfd..894f230216 100644 --- a/lib/Frontend/DocumentXML.cpp +++ b/lib/Frontend/DocumentXML.cpp @@ -199,6 +199,35 @@ void DocumentXML::addPtrAttribute(const char* pAttributeName, } //--------------------------------------------------------- +void DocumentXML::addPtrAttribute(const char* pAttributeName, + const NestedNameSpecifier* pNNS) { + switch (pNNS->getKind()) { + case NestedNameSpecifier::Identifier: { + IdentifierInfo *ii = pNNS->getAsIdentifier(); + // FIXME how should we handle those ? + addPtrAttribute(pAttributeName, ii->getName().data()); + break; + } + case NestedNameSpecifier::Namespace: { + addPtrAttribute(pAttributeName, pNNS->getAsNamespace()); + break; + } + case NestedNameSpecifier::TypeSpec: { + addPtrAttribute(pAttributeName, pNNS->getAsType()); + break; + } + case NestedNameSpecifier::TypeSpecWithTemplate: { + addPtrAttribute(pAttributeName, pNNS->getAsType()); + break; + } + case NestedNameSpecifier::Global: { + addPtrAttribute(pAttributeName, "::"); + break; + } + } +} + +//--------------------------------------------------------- void DocumentXML::addTypeRecursively(const QualType& pType) { if (addToMap(Types, pType)) |