summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/DocumentXML.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-10 17:43:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-10 17:43:18 +0000
commite5279cea49708a7dcddb7c36d0cedbfac27ebee0 (patch)
treec8c5e6adb285415f8d7a770ba08bb7b2d11c4e2f /clang/lib/Frontend/DocumentXML.cpp
parentc2ae5f546fe5a1d904886b5b0f420c7229f4f4d6 (diff)
downloadbcm5719-llvm-e5279cea49708a7dcddb7c36d0cedbfac27ebee0.tar.gz
bcm5719-llvm-e5279cea49708a7dcddb7c36d0cedbfac27ebee0.zip
Improved -ast-print-xml for C++, from Sebastien Binet!
llvm-svn: 103412
Diffstat (limited to 'clang/lib/Frontend/DocumentXML.cpp')
-rw-r--r--clang/lib/Frontend/DocumentXML.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/Frontend/DocumentXML.cpp b/clang/lib/Frontend/DocumentXML.cpp
index 0263c30bfd5..894f230216f 100644
--- a/clang/lib/Frontend/DocumentXML.cpp
+++ b/clang/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))
OpenPOWER on IntegriCloud