diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-08-17 14:23:46 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-08-17 15:49:18 -0400 |
commit | 98e01f56b0a117f0f32ed2f9b7d61e858303333c (patch) | |
tree | 1a61a720609080178c87f9c063a1603a9b61f8dd /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | a9ee0589a8bc1584af4209fe6439c68aa875065f (diff) | |
download | llvm-98e01f56b0a117f0f32ed2f9b7d61e858303333c.zip llvm-98e01f56b0a117f0f32ed2f9b7d61e858303333c.tar.gz llvm-98e01f56b0a117f0f32ed2f9b7d61e858303333c.tar.bz2 |
Revert "Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record"
This reverts commit a3036b386383f1c1e9d32c2c8dba995087959da3.
As requested in: https://reviews.llvm.org/D80833#2221866
Bug report: https://crbug.com/1117026
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index df29440..b388e43 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -68,7 +68,6 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/Path.h" -#include "llvm/Support/Program.h" #include "llvm/Support/SMLoc.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -818,31 +817,6 @@ static TypeIndex getStringIdTypeIdx(GlobalTypeTableBuilder &TypeTable, return TypeTable.writeLeafType(SIR); } -static std::string flattenCommandLine(ArrayRef<const char *> Args, - StringRef MainFilename) { - std::string FlatCmdLine; - raw_string_ostream OS(FlatCmdLine); - StringRef LastArg; - for (StringRef Arg : Args) { - if (Arg.empty()) - continue; - // The command-line shall not contain the file to compile. - if (Arg == MainFilename && LastArg != "-main-file-name") - continue; - // Also remove the output file. - if (Arg == "-o" || LastArg == "-o") { - LastArg = Arg; - continue; - } - if (!LastArg.empty()) - OS << " "; - llvm::sys::printArg(OS, Arg, /*Quote=*/true); - LastArg = Arg; - } - OS.flush(); - return FlatCmdLine; -} - void CodeViewDebug::emitBuildInfo() { // First, make LF_BUILDINFO. It's a sequence of strings with various bits of // build info. The known prefix is: @@ -863,16 +837,8 @@ 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); - BuildInfoArgs[BuildInfoRecord::CommandLine] = getStringIdTypeIdx( - TypeTable, flattenCommandLine(Asm->TM.Options.MCOptions.CommandLineArgs, - MainSourceFile->getFilename())); - } + // FIXME: Path to compiler and command line. PDB is intentionally blank unless + // we implement /Zi type servers. BuildInfoRecord BIR(BuildInfoArgs); TypeIndex BuildInfoIndex = TypeTable.writeLeafType(BIR); |