@@ -23,15 +23,17 @@ struct SwiftDiagnosticsSource {
2323 std::string_view name;
2424 static constexpr std::string_view extractorName = " swift" ;
2525 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;
2729
2830 // for the moment, we only output errors, so no need to store the severity
2931
3032 // 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 () {
3335 static std::once_flag once;
34- std::call_once (once, inscribeImpl, Spec );
36+ std::call_once (once, registerImpl, Source );
3537 }
3638
3739 // gets a previously inscribed SwiftDiagnosticsSource for the given id. Will abort if none exists
@@ -44,7 +46,7 @@ struct SwiftDiagnosticsSource {
4446 void emit (std::ostream& out, std::string_view timestamp, std::string_view message) const ;
4547
4648 private:
47- static void inscribeImpl (const SwiftDiagnosticsSource* Spec );
49+ static void registerImpl (const SwiftDiagnosticsSource* source );
4850
4951 std::string sourceId () const ;
5052 using Map = std::unordered_map<std::string, const SwiftDiagnosticsSource*>;
0 commit comments