================
@@ -7,10 +7,35 @@
//===----------------------------------------------------------------------===//
#include "clang/APINotes/Types.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
+namespace {
+template <typename ParameterT>
+std::string
+formatAPINotesParameterSelectorImpl(llvm::ArrayRef<ParameterT> Parameters) {
+ std::string Result;
+ llvm::raw_string_ostream OS(Result);
+ OS << "[";
+ llvm::interleaveComma(Parameters, OS);
+ OS << "]";
+ return Result;
+}
+} // namespace
+
namespace clang {
namespace api_notes {
+
+std::string
+formatAPINotesParameterSelector(llvm::ArrayRef<llvm::StringRef> Parameters) {
----------------
Xazax-hun wrote:
I wonder if we need these two overloads. Couldn't we call
`formatAPINotesParameterSelectorImpl` directly and let template argument
deduction do the work? Or alternatively, maybe we could just take an arbitrary
range like:
```
template <typename R> std::string formatAPINotesParameterSelector(R &&)
```
https://github.com/llvm/llvm-project/pull/209408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits