}
static void outputReplacementXML(StringRef Text) {
+ // FIXME: When we sort includes, we need to make sure the stream is correct
+ // utf-8.
size_t From = 0;
size_t Index;
- while ((Index = Text.find_first_of("\n\r", From)) != StringRef::npos) {
+ while ((Index = Text.find_first_of("\n\r<&", From)) != StringRef::npos) {
llvm::outs() << Text.substr(From, Index - From);
switch (Text[Index]) {
case '\n':
case '\r':
llvm::outs() << " ";
break;
+ case '<':
+ llvm::outs() << "<";
+ break;
+ case '&':
+ llvm::outs() << "&";
+ break;
default:
llvm_unreachable("Unexpected character encountered!");
}