mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
FileCheck: Eliminate DOSish \r from input file.
It can pass two tests below on Win32. - Clang :: CodeGenCXX/dyncast.cpp - LLVM :: CodeGen/ARM/globals.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -456,6 +456,11 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
|
|||||||
|
|
||||||
for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
|
for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
|
||||||
Ptr != End; ++Ptr) {
|
Ptr != End; ++Ptr) {
|
||||||
|
// Eliminate trailing dosish \r.
|
||||||
|
if (Ptr <= End - 2 && Ptr[0] == '\r' && Ptr[1] == '\n') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// If C is not a horizontal whitespace, skip it.
|
// If C is not a horizontal whitespace, skip it.
|
||||||
if (*Ptr != ' ' && *Ptr != '\t') {
|
if (*Ptr != ' ' && *Ptr != '\t') {
|
||||||
NewFile.push_back(*Ptr);
|
NewFile.push_back(*Ptr);
|
||||||
|
Reference in New Issue
Block a user