Page MenuHomePhabricator

Fix clang Lexer Windows line-ending bug
Needs ReviewPublic

Authored by caoz on Dec 11 2017, 11:29 AM.



Add Windows line-ending support when parsing Perforce conflict marker.

This fixes 2 tests for Bug 35187 (

Diff Detail

Event Timeline

caoz created this revision.Dec 11 2017, 11:29 AM
zturner added inline comments.

Since the user has sed already, why wouldn't they have the actual tool dos2unix and unix2dos?

caoz added inline comments.Dec 11 2017, 11:57 AM

Thanks Zachary. dos2unix and unix2dos aren't installed by default on Linux/Mac. However, if the user can be assumed to have them, I can remove these substitutions.

belleyb added inline comments.Dec 11 2017, 12:24 PM

@zturner According to, we shouldn't be relying on dos2unix nor unix2dos to be present on a build machine.

Note that the $'string' syntax (ANSI-C quotes) is a bash extension. According to the page mentioned above, the LLVM builds should only be relying on having a Bourne shell (sh). But, are there still any *nix system out there where /bin/sh isn't a link for \bin\bash ? I.e. Is relying on bash+sed fine here ?

A fully portable solution would be to write python scripts for and That way, one would not be relying on build tools that LLVM isn't already using.

Any advice on how to proceed ?