Trass3r updated this revision to Diff 466921. Trass3r retitled this revision from "add time traces for loading PCH files" to "add time traces for AST serialization". Trass3r edited the summary of this revision. Trass3r added a reviewer: jansvoboda11. Trass3r added a comment.
rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135657/new/ https://reviews.llvm.org/D135657 Files: clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp Index: clang/lib/Serialization/ASTWriter.cpp =================================================================== --- clang/lib/Serialization/ASTWriter.cpp +++ clang/lib/Serialization/ASTWriter.cpp @@ -100,6 +100,7 @@ #include "llvm/Support/OnDiskHashTable.h" #include "llvm/Support/Path.h" #include "llvm/Support/SHA1.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> @@ -4484,6 +4485,7 @@ Module *WritingModule, StringRef isysroot, bool hasErrors, bool ShouldCacheASTInMemory) { + llvm::TimeTraceScope scope("WriteAST", OutputFile); WritingAST = true; ASTHasCompilerErrors = hasErrors; Index: clang/lib/Serialization/ASTReader.cpp =================================================================== --- clang/lib/Serialization/ASTReader.cpp +++ clang/lib/Serialization/ASTReader.cpp @@ -122,6 +122,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/SaveAndRestore.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Support/Timer.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" @@ -4209,6 +4210,8 @@ SourceLocation ImportLoc, unsigned ClientLoadCapabilities, SmallVectorImpl<ImportedSubmodule> *Imported) { + llvm::TimeTraceScope scope("ReadAST", FileName); + llvm::SaveAndRestore<SourceLocation> SetCurImportLocRAII(CurrentImportLoc, ImportLoc); llvm::SaveAndRestore<Optional<ModuleKind>> SetCurModuleKindRAII(
Index: clang/lib/Serialization/ASTWriter.cpp =================================================================== --- clang/lib/Serialization/ASTWriter.cpp +++ clang/lib/Serialization/ASTWriter.cpp @@ -100,6 +100,7 @@ #include "llvm/Support/OnDiskHashTable.h" #include "llvm/Support/Path.h" #include "llvm/Support/SHA1.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> @@ -4484,6 +4485,7 @@ Module *WritingModule, StringRef isysroot, bool hasErrors, bool ShouldCacheASTInMemory) { + llvm::TimeTraceScope scope("WriteAST", OutputFile); WritingAST = true; ASTHasCompilerErrors = hasErrors; Index: clang/lib/Serialization/ASTReader.cpp =================================================================== --- clang/lib/Serialization/ASTReader.cpp +++ clang/lib/Serialization/ASTReader.cpp @@ -122,6 +122,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/SaveAndRestore.h" +#include "llvm/Support/TimeProfiler.h" #include "llvm/Support/Timer.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" @@ -4209,6 +4210,8 @@ SourceLocation ImportLoc, unsigned ClientLoadCapabilities, SmallVectorImpl<ImportedSubmodule> *Imported) { + llvm::TimeTraceScope scope("ReadAST", FileName); + llvm::SaveAndRestore<SourceLocation> SetCurImportLocRAII(CurrentImportLoc, ImportLoc); llvm::SaveAndRestore<Optional<ModuleKind>> SetCurModuleKindRAII(
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits