[clang-tools-extra] 7370e45 - Fix warnings
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 24 09:52:30 PDT 2023
Author: Kazu Hirata
Date: 2023-03-24T09:52:17-07:00
New Revision: 7370e45fb480672bea6483876090c33df5f66228
URL: https://github.com/llvm/llvm-project/commit/7370e45fb480672bea6483876090c33df5f66228
DIFF: https://github.com/llvm/llvm-project/commit/7370e45fb480672bea6483876090c33df5f66228.diff
LOG: Fix warnings
This patch fixes:
clang/lib/Driver/ToolChains/OHOS.cpp:410:18: warning: unused
variable ‘A’ [-Wunused-variable]
clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp:293:15:
warning: unused variable ‘II’ [-Wunused-variable]
llvm/lib/ProfileData/RawMemProfReader.cpp:364:68: warning: suggest
parentheses around ‘&&’ within ‘||’ [-Wparentheses]
Added:
Modified:
clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
clang/lib/Driver/ToolChains/OHOS.cpp
llvm/lib/ProfileData/RawMemProfReader.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
index 1e51d8fb9a518..5ca45f94ea9f0 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
+++ b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
@@ -290,7 +290,7 @@ bool AddUsing::prepare(const Selection &Inputs) {
SourceRange SpelledNameRange;
if (auto *D = Node->ASTNode.get<DeclRefExpr>()) {
- if (auto *II = D->getDecl()->getIdentifier()) {
+ if (D->getDecl()->getIdentifier()) {
QualifierToRemove = D->getQualifierLoc();
SpelledNameRange = D->getSourceRange();
MustInsertAfterLoc = D->getDecl()->getBeginLoc();
diff --git a/clang/lib/Driver/ToolChains/OHOS.cpp b/clang/lib/Driver/ToolChains/OHOS.cpp
index bd0409d282084..d25c293716430 100644
--- a/clang/lib/Driver/ToolChains/OHOS.cpp
+++ b/clang/lib/Driver/ToolChains/OHOS.cpp
@@ -407,7 +407,7 @@ std::string OHOS::getArchSpecificLibPath() const {
}
ToolChain::UnwindLibType OHOS::GetUnwindLibType(const llvm::opt::ArgList &Args) const {
- if (const Arg *A = Args.getLastArg(options::OPT_unwindlib_EQ))
+ if (Args.getLastArg(options::OPT_unwindlib_EQ))
return Generic_ELF::GetUnwindLibType(Args);
return GetDefaultUnwindLibType();
}
diff --git a/llvm/lib/ProfileData/RawMemProfReader.cpp b/llvm/lib/ProfileData/RawMemProfReader.cpp
index 27df3995ae885..0c14ab4e2031d 100644
--- a/llvm/lib/ProfileData/RawMemProfReader.cpp
+++ b/llvm/lib/ProfileData/RawMemProfReader.cpp
@@ -360,10 +360,10 @@ Error RawMemProfReader::setupForSymbolization() {
}
}
assert(NumMatched != 0 && "No matching executable segments in segment info.");
- assert(PreferredTextSegmentAddress == 0 ||
- (PreferredTextSegmentAddress == ProfiledTextSegmentStart) &&
- "Expect text segment address to be 0 or equal to profiled text "
- "segment start.");
+ assert((PreferredTextSegmentAddress == 0 ||
+ (PreferredTextSegmentAddress == ProfiledTextSegmentStart)) &&
+ "Expect text segment address to be 0 or equal to profiled text "
+ "segment start.");
return Error::success();
}
More information about the cfe-commits
mailing list