Index: lib/IR/AsmWriter.cpp =================================================================== --- lib/IR/AsmWriter.cpp +++ lib/IR/AsmWriter.cpp @@ -2618,8 +2618,9 @@ unsigned i = 0; for (auto &ModPair : moduleVec) { Out << "^" << i++ << " = module: ("; - Out << "path: \"" << ModPair.first << "\""; - Out << ", hash: ("; + Out << "path: \""; + printEscapedString(ModPair.first, Out); + Out << "\", hash: ("; FieldSeparator FS; for (auto Hash : ModPair.second) Out << FS << Hash; Index: test/Assembler/asm-path-writer.ll =================================================================== --- /dev/null +++ test/Assembler/asm-path-writer.ll @@ -0,0 +1,30 @@ +; REQUIRES: system-windows +; RUN: mkdir -p %t.dir\f4folder +; RUN: opt -module-summary %s -o %t.dir\f4folder\thinlto-alias.tmp.o +; RUN: opt -module-summary %p\..\BitCode\Inputs\thinlto-alias.ll -o %t.dir\f4folder\thinlto-alias.tmp2.o +; RUN: llvm-lto -thinlto -o %t.dir\f4folder\thinlto-alias %t.dir\f4folder\thinlto-alias.tmp.o %t.dir\f4folder\thinlto-alias.tmp2.o +; RUN: llvm-dis %t.dir\f4folder\thinlto-alias.thinlto.bc -o %t.dir\f4folder\thinlto-alias.thinlto.dis +; RUN: llvm-as %t.dir\f4folder\thinlto-alias.thinlto.dis + +; ModuleID = 'thinlto-function-summary-callgraph.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define i32 @main() { +entry: + call void (...) @analias() + ret i32 0 +} + +declare void @analias(...) + +; DIS: ^0 = module: (path: "{{.*}}", hash: (0, 0, 0, 0, 0)) +; DIS: ^1 = gv: (name: "analias", summaries: (alias: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), aliasee: ^2))) ; guid = 12695095382722328222 +; DIS: ^2 = gv: (name: "aliasee", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) ; guid = 17407585008595848568 + +; COMBINED-DIS: ^0 = module: (path: "{{.*}}thinlto-alias.ll.tmp.o", hash: (0, 0, 0, 0, 0)) +; COMBINED-DIS: ^1 = module: (path: "{{.*}}thinlto-alias.ll.tmp2.o", hash: (0, 0, 0, 0, 0)) +; COMBINED-DIS: ^2 = gv: (guid: 12695095382722328222, summaries: (alias: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), aliasee: ^4))) +; COMBINED-DIS: ^3 = gv: (guid: 15822663052811949562, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 2, calls: ((callee: ^2))))) +; COMBINED-DIS: ^4 = gv: (guid: 17407585008595848568, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1)))