summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Writer.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-07-12 03:22:39 +0000
committerZachary Turner <zturner@google.com>2018-07-12 03:22:39 +0000
commite2ce2a5c866bd50f24cbb5afbd5b565b538e68a2 (patch)
tree75e50e24079424ec49c5ec8f12a281b0e6e8e3dd /lld/COFF/Writer.cpp
parentfdf13ef342e29d22f96f64a82679609873229d92 (diff)
downloadbcm5719-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.cpp11
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);
OpenPOWER on IntegriCloud