diff options
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); |

