[PATCH] D148812: [NFC][clang] Fix static analyzer concerns
Soumi Manna via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 21 07:44:28 PDT 2023
Manna updated this revision to Diff 515729.
Manna edited the summary of this revision.
Manna added a comment.
I have addressed @erichkeane's review comment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148812/new/
https://reviews.llvm.org/D148812
Files:
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ComputeDependence.cpp
clang/lib/ASTMatchers/Dynamic/Marshallers.h
clang/lib/CodeGen/CGVTables.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
Index: clang/utils/TableGen/ClangAttrEmitter.cpp
===================================================================
--- clang/utils/TableGen/ClangAttrEmitter.cpp
+++ clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -4259,7 +4259,7 @@
// Generate all of the custom appertainsTo functions that the attributes
// will be using.
- for (auto I : Attrs) {
+ for (const auto &I : Attrs) {
const Record &Attr = *I.second;
if (Attr.isValueUnset("Subjects"))
continue;
Index: clang/lib/Sema/SemaDeclCXX.cpp
===================================================================
--- clang/lib/Sema/SemaDeclCXX.cpp
+++ clang/lib/Sema/SemaDeclCXX.cpp
@@ -3971,7 +3971,7 @@
}
llvm::SmallPtrSet<QualType, 4> UninitializedBaseClasses;
- for (auto I : RD->bases())
+ for (const auto &I : RD->bases())
UninitializedBaseClasses.insert(I.getType().getCanonicalType());
if (UninitializedFields.empty() && UninitializedBaseClasses.empty())
Index: clang/lib/CodeGen/CGVTables.cpp
===================================================================
--- clang/lib/CodeGen/CGVTables.cpp
+++ clang/lib/CodeGen/CGVTables.cpp
@@ -1269,13 +1269,13 @@
else
TypeVis = llvm::GlobalObject::VCallVisibilityPublic;
- for (auto B : RD->bases())
+ for (const auto &B : RD->bases())
if (B.getType()->getAsCXXRecordDecl()->isDynamicClass())
TypeVis = std::min(
TypeVis,
GetVCallVisibilityLevel(B.getType()->getAsCXXRecordDecl(), Visited));
- for (auto B : RD->vbases())
+ for (const auto &B : RD->vbases())
if (B.getType()->getAsCXXRecordDecl()->isDynamicClass())
TypeVis = std::min(
TypeVis,
Index: clang/lib/ASTMatchers/Dynamic/Marshallers.h
===================================================================
--- clang/lib/ASTMatchers/Dynamic/Marshallers.h
+++ clang/lib/ASTMatchers/Dynamic/Marshallers.h
@@ -1008,7 +1008,7 @@
Diagnostics *) const override {
std::vector<ASTNodeKind> NodeKinds;
- for (auto Arg : Args) {
+ for (const auto &Arg : Args) {
if (!Arg.Value.isNodeKind())
return {};
NodeKinds.push_back(Arg.Value.getNodeKind());
Index: clang/lib/AST/ComputeDependence.cpp
===================================================================
--- clang/lib/AST/ComputeDependence.cpp
+++ clang/lib/AST/ComputeDependence.cpp
@@ -760,7 +760,7 @@
D |= getDependenceInExpr(E->getNameInfo());
if (auto *Q = E->getQualifier())
D |= toExprDependence(Q->getDependence());
- for (auto A : E->template_arguments())
+ for (const auto &A : E->template_arguments())
D |= toExprDependence(A.getArgument().getDependence());
return D;
}
@@ -813,7 +813,7 @@
if (auto *Q = E->getQualifier())
D |= toExprDependence(Q->getDependence());
D |= getDependenceInExpr(E->getMemberNameInfo());
- for (auto A : E->template_arguments())
+ for (const auto &A : E->template_arguments())
D |= toExprDependence(A.getArgument().getDependence());
return D;
}
Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -8203,7 +8203,7 @@
if (!CXXRD->hasDefinition() || !VisitBasesAndFields)
return false;
- for (auto B : CXXRD->bases())
+ for (const auto &B : CXXRD->bases())
if (hasTemplateSpecializationInEncodedString(B.getType().getTypePtr(),
true))
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148812.515729.patch
Type: text/x-patch
Size: 3515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230421/73e17528/attachment.bin>
More information about the cfe-commits
mailing list