@@ -23,15 +23,17 @@ struct SwiftDiagnosticsSource {
23
23
std::string_view name;
24
24
static constexpr std::string_view extractorName = " swift" ;
25
25
std::string_view action;
26
- std::string_view helpLinks; // space separated if more than 1. Not a vector to allow constexpr
26
+ // space separated if more than 1. Not a vector to allow constexpr
27
+ // TODO(C++20) with vector going constexpr this can be turned to `std::vector<std::string_view>`
28
+ std::string_view helpLinks;
27
29
28
30
// for the moment, we only output errors, so no need to store the severity
29
31
30
32
// registers a diagnostics source for later retrieval with get, if not done yet
31
- template <const SwiftDiagnosticsSource* Spec >
32
- static void inscribe () {
33
+ template <const SwiftDiagnosticsSource* Source >
34
+ static void ensureRegistered () {
33
35
static std::once_flag once;
34
- std::call_once (once, inscribeImpl, Spec );
36
+ std::call_once (once, registerImpl, Source );
35
37
}
36
38
37
39
// gets a previously inscribed SwiftDiagnosticsSource for the given id. Will abort if none exists
@@ -44,7 +46,7 @@ struct SwiftDiagnosticsSource {
44
46
void emit (std::ostream& out, std::string_view timestamp, std::string_view message) const ;
45
47
46
48
private:
47
- static void inscribeImpl (const SwiftDiagnosticsSource* Spec );
49
+ static void registerImpl (const SwiftDiagnosticsSource* source );
48
50
49
51
std::string sourceId () const ;
50
52
using Map = std::unordered_map<std::string, const SwiftDiagnosticsSource*>;
0 commit comments