Format GetCanonicalUseLocation

This function had some bad indentation that disagrees with clang-format.

To prepare for some changes and make their diff more focused, reformat
up-front.
This commit is contained in:
Kim Gräsman 2023-01-07 11:17:31 +01:00
parent 7864ab35f4
commit 8a735a52e1
1 changed files with 8 additions and 10 deletions

18
iwyu.cc
View File

@ -1237,8 +1237,8 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
if (!use_loc.isMacroID())
return use_loc;
VERRS(5) << "Trying to determine use location for '"
<< PrintableDecl(decl) << "'\n";
VERRS(5) << "Trying to determine use location for '" << PrintableDecl(decl)
<< "'\n";
clang::SourceManager* sm = GlobalSourceManager();
SourceLocation spelling_loc = sm->getSpellingLoc(use_loc);
@ -1262,7 +1262,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
if (!fwd_decl) {
if (const auto* func_decl = dyn_cast<FunctionDecl>(decl)) {
if (const FunctionTemplateDecl* ft_decl =
func_decl->getPrimaryTemplate()) {
func_decl->getPrimaryTemplate()) {
VERRS(5) << "No fwd-decl found, looking for function template decl\n";
for (const NamedDecl* redecl : ft_decl->redecls()) {
if (GetFileEntry(redecl) == macro_def_file) {
@ -1275,13 +1275,11 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
}
if (fwd_decl) {
// Make sure we keep that forward-declaration, even if it's probably
// unused in this file.
IwyuFileInfo* file_info =
preprocessor_info().FileInfoFor(macro_def_file);
file_info->ReportForwardDeclareUse(
spelling_loc, fwd_decl,
ComputeUseFlags(current_ast_node()), nullptr);
// Make sure we keep that forward-declaration, even if it's probably
// unused in this file.
IwyuFileInfo* file_info = preprocessor_info().FileInfoFor(macro_def_file);
file_info->ReportForwardDeclareUse(
spelling_loc, fwd_decl, ComputeUseFlags(current_ast_node()), nullptr);
}
// Resolve the best use location based on our current knowledge.