mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sourcekitd] Add a request to get statistics from the service
... and add a few basic statistics about the number of requests, ASTs built, etc. The Statistic type is loosely based on the one from LLVM, but suitable for using without DEBUG macros and using SourceKit UIdents to identify the statistic. The easiest way to add a new statistic is to add it to SwiftStatistics.def in the SwiftLangSupport.
This commit is contained in:
@@ -715,6 +715,14 @@ std::string SwiftLangSupport::resolvePathSymlinks(StringRef FilePath) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void SwiftLangSupport::getStatistics(StatisticsReceiver receiver) {
|
||||
std::vector<Statistic *> stats = {
|
||||
#define SWIFT_STATISTIC(VAR, UID, DESC) &Stats.VAR,
|
||||
#include "SwiftStatistics.def"
|
||||
};
|
||||
receiver(stats);
|
||||
}
|
||||
|
||||
CloseClangModuleFiles::~CloseClangModuleFiles() {
|
||||
clang::Preprocessor &PP = loader.getClangPreprocessor();
|
||||
clang::ModuleMap &ModMap = PP.getHeaderSearchInfo().getModuleMap();
|
||||
|
||||
Reference in New Issue
Block a user