[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
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp
index a0a5512..c0e5bc2 100644
--- a/tools/libclang/CXComment.cpp
+++ b/tools/libclang/CXComment.cpp
@@ -1176,10 +1176,24 @@
     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 @@
       }
       // 'unavailable' attribute.
       if (AA->getUnavailable())
-        Result << "<Unavailable>true</Unavailable>";
+        Result << "<Unavailable/>";
       Result << "</Availability>";
     }
   }