r326110 - Fix for LLVM r326109
David Zarzycki via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 26 10:42:30 PST 2018
Author: davezarzycki
Date: Mon Feb 26 10:42:30 2018
New Revision: 326110
URL: http://llvm.org/viewvc/llvm-project?rev=326110&view=rev
Log:
Fix for LLVM r326109
Modified:
cfe/trunk/lib/Basic/SourceManager.cpp
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=326110&r1=326109&r2=326110&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Feb 26 10:42:30 2018
@@ -170,8 +170,10 @@ llvm::MemoryBuffer *ContentCache::getBuf
const char *InvalidBOM = llvm::StringSwitch<const char *>(BufStr)
.StartsWith("\xFE\xFF", "UTF-16 (BE)")
.StartsWith("\xFF\xFE", "UTF-16 (LE)")
- .StartsWith("\x00\x00\xFE\xFF", "UTF-32 (BE)")
- .StartsWith("\xFF\xFE\x00\x00", "UTF-32 (LE)")
+ .StartsWith(llvm::StringLiteral::withInnerNUL("\x00\x00\xFE\xFF"),
+ "UTF-32 (BE)")
+ .StartsWith(llvm::StringLiteral::withInnerNUL("\xFF\xFE\x00\x00"),
+ "UTF-32 (LE)")
.StartsWith("\x2B\x2F\x76", "UTF-7")
.StartsWith("\xF7\x64\x4C", "UTF-1")
.StartsWith("\xDD\x73\x66\x73", "UTF-EBCDIC")
More information about the cfe-commits
mailing list