[cfe-commits] r49877 - /cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
Chris Lattner
sabre at nondot.org
Thu Apr 17 16:03:14 PDT 2008
Author: lattner
Date: Thu Apr 17 18:03:14 2008
New Revision: 49877
URL: http://llvm.org/viewvc/llvm-project?rev=49877&view=rev
Log:
Fix a problem noticed by Nuno, where we wouldn't escape characters in
macro expansions.
Modified:
cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=49877&r1=49876&r2=49877&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Thu Apr 17 18:03:14 2008
@@ -451,11 +451,12 @@
}
LineLen -= Expansion.size();
- Expansion += ' ' + PP->getSpelling(Tok);
+ // Escape any special characters in the token text.
+ Expansion += ' ' + EscapeText(PP->getSpelling(Tok));
LineLen += Expansion.size();
PP->Lex(Tok);
}
-
+
// Insert the information about the expansion inside the macro span.
Expansion = "<span class='expansion'>" + Expansion + "</span>";
RB.InsertTextBefore(TokOffs+TokLen, Expansion.c_str(), Expansion.size());
More information about the cfe-commits
mailing list