diff options
author | dim <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
commit | e7bcad327814a78ecb8d5f5545d2e3df84c67a5c (patch) | |
tree | ac719b5984165053bf83d71142e4d96b609b9784 /lib/StaticAnalyzer/Core/CheckerHelpers.cpp | |
parent | 9dd834653b811ad20382e98a87dff824980c9916 (diff) | |
download | FreeBSD-src-e7bcad327814a78ecb8d5f5545d2e3df84c67a5c.zip FreeBSD-src-e7bcad327814a78ecb8d5f5545d2e3df84c67a5c.tar.gz |
Vendor import of clang trunk r241361:
https://llvm.org/svn/llvm-project/cfe/trunk@241361
Diffstat (limited to 'lib/StaticAnalyzer/Core/CheckerHelpers.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/CheckerHelpers.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/StaticAnalyzer/Core/CheckerHelpers.cpp b/lib/StaticAnalyzer/Core/CheckerHelpers.cpp index 28df695..3d9a815 100644 --- a/lib/StaticAnalyzer/Core/CheckerHelpers.cpp +++ b/lib/StaticAnalyzer/Core/CheckerHelpers.cpp @@ -22,11 +22,9 @@ bool clang::ento::containsMacro(const Stmt *S) { if (S->getLocEnd().isMacroID()) return true; - for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end(); - ++I) - if (const Stmt *child = *I) - if (containsMacro(child)) - return true; + for (const Stmt *Child : S->children()) + if (Child && containsMacro(Child)) + return true; return false; } @@ -38,11 +36,9 @@ bool clang::ento::containsEnum(const Stmt *S) { if (DR && isa<EnumConstantDecl>(DR->getDecl())) return true; - for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end(); - ++I) - if (const Stmt *child = *I) - if (containsEnum(child)) - return true; + for (const Stmt *Child : S->children()) + if (Child && containsEnum(Child)) + return true; return false; } @@ -56,11 +52,9 @@ bool clang::ento::containsStaticLocal(const Stmt *S) { if (VD->isStaticLocal()) return true; - for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end(); - ++I) - if (const Stmt *child = *I) - if (containsStaticLocal(child)) - return true; + for (const Stmt *Child : S->children()) + if (Child && containsStaticLocal(Child)) + return true; return false; } @@ -70,11 +64,9 @@ bool clang::ento::containsBuiltinOffsetOf(const Stmt *S) { if (isa<OffsetOfExpr>(S)) return true; - for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end(); - ++I) - if (const Stmt *child = *I) - if (containsBuiltinOffsetOf(child)) - return true; + for (const Stmt *Child : S->children()) + if (Child && containsBuiltinOffsetOf(Child)) + return true; return false; } |