Escape filenames in module map line marker directives, to unbreak Windows build bots.

llvm-svn: 304464
This commit is contained in:
Richard Smith 2017-06-01 20:10:35 +00:00
parent 85a83c2ced
commit c784e96eac
2 changed files with 10 additions and 4 deletions

View File

@ -546,8 +546,11 @@ void PrintPreprocessedAction::ExecuteAction() {
// module itself before switching to the input buffer.
auto &Input = getCurrentInput();
if (Input.getKind().getFormat() == InputKind::ModuleMap) {
if (Input.isFile())
(*OS) << "# 1 \"" << Input.getFile() << "\"\n";
if (Input.isFile()) {
(*OS) << "# 1 \"";
OS->write_escaped(Input.getFile());
(*OS) << "\"\n";
}
// FIXME: Include additional information here so that we don't need the
// original source files to exist on disk.
getCurrentModule()->print(*OS);

View File

@ -200,8 +200,11 @@ void RewriteIncludesAction::ExecuteAction() {
// module itself before switching to the input buffer.
auto &Input = getCurrentInput();
if (Input.getKind().getFormat() == InputKind::ModuleMap) {
if (Input.isFile())
(*OS) << "# 1 \"" << Input.getFile() << "\"\n";
if (Input.isFile()) {
(*OS) << "# 1 \"";
OS->write_escaped(Input.getFile());
(*OS) << "\"\n";
}
// FIXME: Include additional information here so that we don't need the
// original source files to exist on disk.
getCurrentModule()->print(*OS);