diff options
author | Reid Kleckner <rnk@google.com> | 2017-10-31 21:52:15 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-10-31 21:52:15 +0000 |
commit | bc6f52da82b4a0383fa2f2c4e056b43b6e5ddaf7 (patch) | |
tree | 59ace88ba3fab23901628055b53262414b113fbb /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 374f71ac90dd0b84ede33cecd245e37da2012788 (diff) | |
download | llvm-bc6f52da82b4a0383fa2f2c4e056b43b6e5ddaf7.zip llvm-bc6f52da82b4a0383fa2f2c4e056b43b6e5ddaf7.tar.gz llvm-bc6f52da82b4a0383fa2f2c4e056b43b6e5ddaf7.tar.bz2 |
[codeview] Merge file checksum entries for DIFiles with the same absolute path
Change the map key from DIFile* to the absolute path string. Computing
the absolute path isn't expensive because we already have a map that
caches the full path keyed on DIFile*.
llvm-svn: 317041
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 7d50d64..67bab8c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -154,11 +154,11 @@ StringRef CodeViewDebug::getFullFilepath(const DIFile *File) { } unsigned CodeViewDebug::maybeRecordFile(const DIFile *F) { + StringRef FullPath = getFullFilepath(F); unsigned NextId = FileIdMap.size() + 1; - auto Insertion = FileIdMap.insert(std::make_pair(F, NextId)); + auto Insertion = FileIdMap.insert(std::make_pair(FullPath, NextId)); if (Insertion.second) { // We have to compute the full filepath and emit a .cv_file directive. - StringRef FullPath = getFullFilepath(F); std::string Checksum = fromHex(F->getChecksum()); void *CKMem = OS.getContext().allocate(Checksum.size(), 1); memcpy(CKMem, Checksum.data(), Checksum.size()); |