|
| 1 | +//===--- ClangImporterRequests.h - Clang Importer Requests ------*- C++ -*-===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2021 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | +// |
| 13 | +// This file defines clang-importer requests. |
| 14 | +// |
| 15 | +//===----------------------------------------------------------------------===// |
| 16 | +#ifndef SWIFT_CLANG_IMPORTER_REQUESTS_H |
| 17 | +#define SWIFT_CLANG_IMPORTER_REQUESTS_H |
| 18 | + |
| 19 | +#include "swift/AST/SimpleRequest.h" |
| 20 | +#include "swift/AST/ASTTypeIDs.h" |
| 21 | +#include "swift/AST/EvaluatorDependencies.h" |
| 22 | + |
| 23 | +namespace swift { |
| 24 | + |
| 25 | +#define SWIFT_TYPEID_ZONE ClangImporter |
| 26 | +#define SWIFT_TYPEID_HEADER "swift/ClangImporter/ClangImporterTypeIDZone.def" |
| 27 | +#include "swift/Basic/DefineTypeIDZone.h" |
| 28 | +#undef SWIFT_TYPEID_ZONE |
| 29 | +#undef SWIFT_TYPEID_HEADER |
| 30 | + |
| 31 | +// Set up reporting of evaluated requests. |
| 32 | +template<typename Request> |
| 33 | +void reportEvaluatedRequest(UnifiedStatsReporter &stats, |
| 34 | + const Request &request); |
| 35 | + |
| 36 | +#define SWIFT_REQUEST(Zone, RequestType, Sig, Caching, LocOptions) \ |
| 37 | + template <> \ |
| 38 | + inline void reportEvaluatedRequest(UnifiedStatsReporter &stats, \ |
| 39 | + const RequestType &request) { \ |
| 40 | + ++stats.getFrontendCounters().RequestType; \ |
| 41 | + } |
| 42 | +#include "swift/ClangImporter/ClangImporterTypeIDZone.def" |
| 43 | +#undef SWIFT_REQUEST |
| 44 | + |
| 45 | +} // end namespace swift |
| 46 | + |
| 47 | +#endif // SWIFT_CLANG_IMPORTER_REQUESTS_H |
| 48 | + |
0 commit comments