diff options
| author | Zachary Turner <zturner@google.com> | 2018-07-12 03:22:39 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2018-07-12 03:22:39 +0000 |
| commit | e2ce2a5c866bd50f24cbb5afbd5b565b538e68a2 (patch) | |
| tree | 75e50e24079424ec49c5ec8f12a281b0e6e8e3dd /lld/COFF/Writer.cpp | |
| parent | fdf13ef342e29d22f96f64a82679609873229d92 (diff) | |
| download | bcm5719-llvm-e2ce2a5c866bd50f24cbb5afbd5b565b538e68a2.tar.gz bcm5719-llvm-e2ce2a5c866bd50f24cbb5afbd5b565b538e68a2.zip | |
[coff] remove_dots from /PDBPATH but not /PDBALTPATH.
This more closely matches the behavior of link.exe, and also
simplifies the code slightly.
llvm-svn: 336882
Diffstat (limited to 'lld/COFF/Writer.cpp')
| -rw-r--r-- | lld/COFF/Writer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index adb15c85686..e9b21df478a 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -122,7 +122,7 @@ private: class CVDebugRecordChunk : public Chunk { public: size_t getSize() const override { - return sizeof(codeview::DebugInfo) + Path.size() + 1; + return sizeof(codeview::DebugInfo) + Config->PDBAltPath.size() + 1; } void writeTo(uint8_t *B) const override { @@ -132,12 +132,11 @@ public: // variable sized field (PDB Path) char *P = reinterpret_cast<char *>(B + OutputSectionOff + sizeof(*BuildId)); - if (!Path.empty()) - memcpy(P, Path.data(), Path.size()); - P[Path.size()] = '\0'; + if (!Config->PDBAltPath.empty()) + memcpy(P, Config->PDBAltPath.data(), Config->PDBAltPath.size()); + P[Config->PDBAltPath.size()] = '\0'; } - SmallString<128> Path; mutable codeview::DebugInfo *BuildId = nullptr; }; @@ -510,8 +509,6 @@ void Writer::createMiscChunks() { // if we're ultimately not going to write CodeView data to the PDB. auto *CVChunk = make<CVDebugRecordChunk>(); BuildId = CVChunk; - CVChunk->Path = Config->PDBAltPath; - llvm::sys::path::remove_dots(CVChunk->Path); DebugRecords.push_back(CVChunk); RdataSec->addChunk(DebugDirectory); |

