From 9415fbbbcf73ab90692fafdac5bd6e302d07ba4b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 18 Feb 2022 17:27:32 +0000 Subject: [PATCH] [clangd] getHover - pass FormatStyle argument by const reference Reported by coverity --- clang-tools-extra/clangd/Hover.cpp | 2 +- clang-tools-extra/clangd/Hover.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp index dda5ad3..8b220184 100644 --- a/clang-tools-extra/clangd/Hover.cpp +++ b/clang-tools-extra/clangd/Hover.cpp @@ -963,7 +963,7 @@ void maybeAddCalleeArgInfo(const SelectionTree::Node *N, HoverInfo &HI, } // namespace llvm::Optional getHover(ParsedAST &AST, Position Pos, - format::FormatStyle Style, + const format::FormatStyle &Style, const SymbolIndex *Index) { PrintingPolicy PP = getPrintingPolicy(AST.getASTContext().getPrintingPolicy()); diff --git a/clang-tools-extra/clangd/Hover.h b/clang-tools-extra/clangd/Hover.h index 7478ede..1a46ff5 100644 --- a/clang-tools-extra/clangd/Hover.h +++ b/clang-tools-extra/clangd/Hover.h @@ -137,7 +137,7 @@ inline bool operator==(const HoverInfo::Param &LHS, /// Get the hover information when hovering at \p Pos. llvm::Optional getHover(ParsedAST &AST, Position Pos, - format::FormatStyle Style, + const format::FormatStyle &Style, const SymbolIndex *Index); } // namespace clangd -- 2.7.4