Comment to XML conversion: replace string comparison with command ID comparison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174290 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CXComment.cpp b/tools/libclang/CXComment.cpp
index afde872..3fa7c4a 100644
--- a/tools/libclang/CXComment.cpp
+++ b/tools/libclang/CXComment.cpp
@@ -1107,9 +1107,14 @@
if (NumLines == 0)
return;
- Result << llvm::StringSwitch<const char *>(C->getCommandName(Traits))
- .Case("code", "<Verbatim xml:space=\"preserve\" kind=\"code\">")
- .Default("<Verbatim xml:space=\"preserve\" kind=\"verbatim\">");
+ switch (C->getCommandID()) {
+ case CommandTraits::KCI_code:
+ Result << "<Verbatim xml:space=\"preserve\" kind=\"code\">";
+ break;
+ default:
+ Result << "<Verbatim xml:space=\"preserve\" kind=\"verbatim\">";
+ break;
+ }
for (unsigned i = 0; i != NumLines; ++i) {
appendToResultWithXMLEscaping(C->getText(i));
if (i + 1 != NumLines)