[clang-tidy] Remove unnecessary getName() on Decls and Types feeding into a DiagnosticBuilder
Going through a string removes some of the smarts of the diagnosic printer
and makes the code more complicated. This change has some cosmetic impact
on the output but that's mostly minor.
llvm-svn: 265680
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
index 3927a78..b2504d4 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
@@ -67,8 +67,7 @@
const MatchFinder::MatchResult &Result, const FunctionDecl *Function,
unsigned ParamIndex) {
const auto *Param = Function->getParamDecl(ParamIndex);
- auto MyDiag = diag(Param->getLocation(), "parameter '%0' is unused")
- << Param->getName();
+ auto MyDiag = diag(Param->getLocation(), "parameter %0 is unused") << Param;
auto DeclRefExpr =
declRefExpr(to(equalsNode(Function)),