================
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef<const 
ParmVarDecl *> Params) {
   return Params;
 }
 
+llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) {
+  if (Capture.capturesVariable())
+    return Capture.getCapturedVar()->getName();
+  if (Capture.capturesThis())
+    return llvm::StringRef{"this"};
+  return llvm::StringRef{"unknown"};
+}
+
+template <typename R, typename P>
+std::string joinAndTruncate(R &&Range, size_t MaxLength,
+                            P &&GetAsStringFunction) {
+  std::string Out;
+  bool IsFirst = true;
+  for (auto &&Element : Range) {
+    if (!IsFirst)
+      Out.append(", ");
+    else
+      IsFirst = false;
----------------
torshepherd wrote:

Changed this to use raw_string_ostream, lmk how it looks

https://github.com/llvm/llvm-project/pull/95712
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to