We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5995e4b commit fbf6c06Copy full SHA for fbf6c06
llvm/lib/MC/MCParser/AsmParser.cpp
@@ -3037,7 +3037,11 @@ bool AsmParser::parseEscapedString(std::string &Data) {
3037
StringRef Str = getTok().getStringContents();
3038
for (unsigned i = 0, e = Str.size(); i != e; ++i) {
3039
if (Str[i] != '\\') {
3040
- if (Str[i] == '\n') {
+ if ((Str[i] == '\n') || (Str[i] == '\r')) {
3041
+ // Don't double-warn for Windows newlines.
3042
+ if ((Str[i] == '\n') && (i > 0) && (Str[i - 1] == '\r'))
3043
+ continue;
3044
+
3045
SMLoc NewlineLoc = SMLoc::getFromPointer(Str.data() + i);
3046
if (Warning(NewlineLoc, "unterminated string; newline inserted"))
3047
return true;
0 commit comments