================
@@ -898,6 +899,25 @@ static std::string convertCallArgsToString(Sema &S,
return Result;
}
+static std::string
+printCallArgsValueCategoryAndType(Sema &S, llvm::ArrayRef<const Expr *> Args) {
+ std::string Result;
+ llvm::raw_string_ostream OS(Result);
+ llvm::ListSeparator Comma;
+ OS << "(";
+ for (const Expr *Arg : Args) {
+ ExprValueKind EVK = Arg->getValueKind();
+ const char *ValueCategory =
+ (EVK == VK_LValue ? "lvalue"
----------------
AaronBallman wrote:
This function doesn't actually print anything, so the name is a bit surprising.
But I've got concerns with this approach as well.
1) We want all diagnostic text to be in the .td file (largely to ease folks who
are translating diagnostics into other languages)
2) This is using standards terminology in an unhelpful way; value categories
are not something we want to force users to reason about. Why is the value
category even important?
3) I suspect this is going to be verbose in practice given how long C++ type
names can be (and this scales with the number of arguments passe).
Can you help me understand how this information helps the user determine how to
fix the reported issue? Maybe we don't need to print it at all?
https://github.com/llvm/llvm-project/pull/152403
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits