summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp
index 6ef987354aa..9fd90102f72 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp
@@ -47,7 +47,7 @@ void PDBTypeServerHandler::addSearchPath(StringRef Path) {
if (Path.empty() || !sys::fs::is_directory(Path))
return;
- SearchPaths.push_back(Path);
+ SearchPaths.insert(Path);
}
Expected<bool>
@@ -86,13 +86,14 @@ Expected<bool> PDBTypeServerHandler::handle(TypeServer2Record &TS,
cv_error_code::corrupt_record,
"TypeServer2Record does not contain filename!");
- for (auto Path : SearchPaths) {
- sys::path::append(Path, File);
- if (!sys::fs::exists(Path))
+ for (auto &Path : SearchPaths) {
+ SmallString<64> PathStr = Path.getKey();
+ sys::path::append(PathStr, File);
+ if (!sys::fs::exists(PathStr))
continue;
std::unique_ptr<IPDBSession> ThisSession;
- if (auto EC = loadDataForPDB(PDB_ReaderType::Native, Path, ThisSession)) {
+ if (auto EC = loadDataForPDB(PDB_ReaderType::Native, PathStr, ThisSession)) {
// It is not an error if this PDB fails to load, it just means that it
// doesn't match and we should continue searching.
ignoreErrors(std::move(EC));
OpenPOWER on IntegriCloud