diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-06-18 16:17:05 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-06-18 16:18:46 -0400 |
commit | 2ae0df5be7408a79524743762b6c74953f31b805 (patch) | |
tree | 972ed46ce3f17f672a0701e9063dfcbec2370965 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 21e14cce23582fcd622b97d643a4e9b2f10a0583 (diff) | |
download | llvm-2ae0df5be7408a79524743762b6c74953f31b805.zip llvm-2ae0df5be7408a79524743762b6c74953f31b805.tar.gz llvm-2ae0df5be7408a79524743762b6c74953f31b805.tar.bz2 |
[CodeView] Revert 8374bf43634725dc02a262a77b5f940fca25938c and 403f9537924b8910ed4f741ed96c61f5e657915b
This reverts:
8374bf43634725dc02a262a77b5f940fca25938c [CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the 'pdb' entry which was previously a null reference, now an empty string.
403f9537924b8910ed4f741ed96c61f5e657915b [CodeView] Add full repro to LF_BUILDINFO record
This is causing the lld/test/COFF/pdb-relative-source-lines.test to fail: http://lab.llvm.org:8011/builders/lld-x86_64-win/builds/1096/steps/test-check-all/logs/FAIL%3A%20lld%3A%3Apdb-relative-source-lines.test
And clang/test/CodeGen/debug-info-codeview-buildinfo.c fails as well: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/33346/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adebug-info-codeview-buildinfo.c
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 cf3c38c..f7041c0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -77,7 +77,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" @@ -832,31 +831,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: @@ -877,16 +851,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); |