================
@@ -503,7 +502,14 @@ class DiagnosticsEngine : public
RefCountedBase<DiagnosticsEngine> {
};
/// The diagnostic states for each file.
- mutable std::map<FileID, File> Files;
+ mutable llvm::DenseMap<FileID, std::unique_ptr<File>> Files;
+
+ std::pair<File *, bool> getOrInsertFile(FileID ID) const {
+ auto [It, Inserted] = Files.try_emplace(ID);
+ if (Inserted)
+ It->second = std::make_unique<File>();
----------------
wangpc-pp wrote:
I tried, but it doesn't seem to help to reduce compile time.
https://github.com/llvm/llvm-project/pull/241234
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits