diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-04-07 14:55:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-04-07 14:55:25 +0000 |
commit | a62e2232815e537952bd6df271763521a0472498 (patch) | |
tree | ea5a784158442dae656b208e3d436cbc624fa55b /clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp | |
parent | 53f7c0ea8e02e2a49f13e713ec6bdbfe067e8383 (diff) | |
download | bcm5719-llvm-a62e2232815e537952bd6df271763521a0472498.tar.gz bcm5719-llvm-a62e2232815e537952bd6df271763521a0472498.zip |
[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
Diffstat (limited to 'clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp index 5f3d2b2cccd..04dadfbfad6 100644 --- a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp @@ -85,16 +85,12 @@ void ImplicitCastInLoopCheck::ReportAndFix( QualType ConstType = OperatorCall->getType().withConst(); QualType ConstRefType = Context->getLValueReferenceType(ConstType); const char Message[] = - "the type of the loop variable '%0' is different from the one returned " + "the type of the loop variable %0 is different from the one returned " "by the iterator and generates an implicit cast; you can either " - "change the type to the correct one ('%1' but 'const auto&' is always a " + "change the type to the correct one (%1 but 'const auto&' is always a " "valid option) or remove the reference to make it explicit that you are " "creating a new value"; - PrintingPolicy Policy(Context->getLangOpts()); - Policy.SuppressTagKeyword = true; - - diag(VD->getLocStart(), Message) << VD->getName() - << ConstRefType.getAsString(Policy); + diag(VD->getLocStart(), Message) << VD << ConstRefType; } } // namespace performance |