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 | e61fc44c3d102c4bad0cd565dd9aaceb5e6a125a (patch) | |
| tree | c2ed7f444356f8c59e8b131eecb301eacc053640 /clang/tools | |
| parent | b09f0a3c75f3c5aa2ba309ddcb4e21d60053b130 (diff) | |
| download | bcm5719-llvm-e61fc44c3d102c4bad0cd565dd9aaceb5e6a125a.tar.gz bcm5719-llvm-e61fc44c3d102c4bad0cd565dd9aaceb5e6a125a.zip | |
[Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.
llvm-svn: 165066
Diffstat (limited to 'clang/tools')
| -rw-r--r-- | clang/tools/libclang/CXComment.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/clang/tools/libclang/CXComment.cpp b/clang/tools/libclang/CXComment.cpp index a0a5512814a..c0e5bc27217 100644 --- a/clang/tools/libclang/CXComment.cpp +++ b/clang/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>"; } } |

