diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-06-18 10:02:02 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-06-18 10:07:30 -0400 |
commit | 8374bf43634725dc02a262a77b5f940fca25938c (patch) | |
tree | f492f39bb90692974d33e9992384afc68b7a8c0e /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 0c66af970c806d65d9335c7272610c82c2388e31 (diff) | |
download | llvm-8374bf43634725dc02a262a77b5f940fca25938c.zip llvm-8374bf43634725dc02a262a77b5f940fca25938c.tar.gz llvm-8374bf43634725dc02a262a77b5f940fca25938c.tar.bz2 |
[CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the 'pdb' entry which was previously a null reference, now an empty string.
Previously, the DIA SDK didn't like the empty reference in the 'pdb' entry.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 7f47849..cf3c38c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -849,10 +849,11 @@ static std::string flattenCommandLine(ArrayRef<const char *> Args, continue; } if (!LastArg.empty()) - FlatCmdLine += " "; + OS << " "; llvm::sys::printArg(OS, Arg, /*Quote=*/true); LastArg = Arg; } + OS.flush(); return FlatCmdLine; } @@ -876,6 +877,9 @@ void CodeViewDebug::emitBuildInfo() { getStringIdTypeIdx(TypeTable, MainSourceFile->getDirectory()); BuildInfoArgs[BuildInfoRecord::SourceFile] = getStringIdTypeIdx(TypeTable, MainSourceFile->getFilename()); + // FIXME: PDB is intentionally blank unless we implement /Zi type servers. + BuildInfoArgs[BuildInfoRecord::TypeServerPDB] = + getStringIdTypeIdx(TypeTable, ""); if (Asm->TM.Options.MCOptions.Argv0 != nullptr) { BuildInfoArgs[BuildInfoRecord::BuildTool] = getStringIdTypeIdx(TypeTable, Asm->TM.Options.MCOptions.Argv0); @@ -883,7 +887,6 @@ void CodeViewDebug::emitBuildInfo() { TypeTable, flattenCommandLine(Asm->TM.Options.MCOptions.CommandLineArgs, MainSourceFile->getFilename())); } - // FIXME: PDB is intentionally blank unless we implement /Zi type servers. BuildInfoRecord BIR(BuildInfoArgs); TypeIndex BuildInfoIndex = TypeTable.writeLeafType(BIR); |