#define LLVM_DEBUGINFO_PDB_PDBTYPESERVERHANDLER_H
#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/DebugInfo/CodeView/TypeServerHandler.h"
#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
bool RevisitAlways;
std::unique_ptr<NativeSession> Session;
- SmallVector<SmallString<64>, 4> SearchPaths;
+ StringSet<> SearchPaths;
};
}
}
if (Path.empty() || !sys::fs::is_directory(Path))
return;
- SearchPaths.push_back(Path);
+ SearchPaths.insert(Path);
}
Expected<bool>
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));