r174290 - Comment to XML conversion: replace string comparison with command ID comparison
Dmitri Gribenko
gribozavr at gmail.com
Sun Feb 3 09:48:05 PST 2013
Author: gribozavr
Date: Sun Feb 3 11:48:05 2013
New Revision: 174290
URL: http://llvm.org/viewvc/llvm-project?rev=174290&view=rev
Log:
Comment to XML conversion: replace string comparison with command ID comparison
Modified:
cfe/trunk/tools/libclang/CXComment.cpp
Modified: cfe/trunk/tools/libclang/CXComment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXComment.cpp?rev=174290&r1=174289&r2=174290&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXComment.cpp (original)
+++ cfe/trunk/tools/libclang/CXComment.cpp Sun Feb 3 11:48:05 2013
@@ -1107,9 +1107,14 @@ void CommentASTToXMLConverter::visitVerb
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)
More information about the cfe-commits
mailing list