diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-02 23:01:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-02 23:01:04 +0000 |
commit | 8da68b8b03d72314b67ea44568e013ef79d93b40 (patch) | |
tree | 451bd5c1d6407724a047208d729a129376f85f2a /tools/libclang/CXComment.cpp | |
parent | 86e7b7e4421eacdd5ae610a0fb2d8ea5dec5e644 (diff) |
[Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CXComment.cpp')
-rw-r--r-- | tools/libclang/CXComment.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp index a0a5512814..c0e5bc2721 100644 --- a/tools/libclang/CXComment.cpp +++ b/tools/libclang/CXComment.cpp @@ -1176,10 +1176,24 @@ void CommentASTToXMLConverter::visitFullComment(const FullComment *C) { for (unsigned i = 0, e = Attrs.size(); i != e; i++) { const AvailabilityAttr *AA = dyn_cast<AvailabilityAttr>(Attrs[i]); if (!AA) { - if (isa<DeprecatedAttr>(Attrs[i])) - Result << "<Deprecated>true</Deprecated>"; - else if (isa<UnavailableAttr>(Attrs[i])) - Result << "<Unavailable>true</Unavailable>"; + if (const DeprecatedAttr *DA = dyn_cast<DeprecatedAttr>(Attrs[i])) { + if (DA->getMessage().empty()) + Result << "<Deprecated/>"; + else { + Result << "<Deprecated>" + << DA->getMessage() + << "</Deprecated>"; + } + } + else if (const UnavailableAttr *UA = dyn_cast<UnavailableAttr>(Attrs[i])) { + if (UA->getMessage().empty()) + Result << "<Unavailable/>"; + else { + Result << "<Unavailable>" + << UA->getMessage() + << "</Unavailable>"; + } + } continue; } @@ -1220,7 +1234,7 @@ void CommentASTToXMLConverter::visitFullComment(const FullComment *C) { } // 'unavailable' attribute. if (AA->getUnavailable()) - Result << "<Unavailable>true</Unavailable>"; + Result << "<Unavailable/>"; Result << "</Availability>"; } } |