================
@@ -54,14 +54,24 @@ inline bool IsLifetimeSafetyEnabled(Sema &S, const Decl *D) 
{
   return false;
 }
 
+inline StringRef formatExpr(const Expr *E) {
+  const Expr *PureExpr = E->IgnoreImpCasts();
+  if (const DeclRefExpr *DRExpr = dyn_cast<DeclRefExpr>(PureExpr))
+    return DRExpr->getDecl()->getName();
----------------
NeKon69 wrote:

Just a quick note: I recently found out that you can pass to diagnostics 
`DRExpr->getDecl()` directly. That will also add quotes to the variable names!

https://github.com/llvm/llvm-project/pull/199345
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to