]> granicus.if.org Git - clang/commitdiff
Move some helpers from the global namespace into anonymous ones.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 13 Oct 2018 22:18:22 +0000 (22:18 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 13 Oct 2018 22:18:22 +0000 (22:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344468 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp

index 1f9bdeb059c7a2eb9f2cdd33a28e23073028ebbc..3aa21b84f68d16710fe558f936e4e3caff51e859 100644 (file)
@@ -196,6 +196,7 @@ bool CallAndMessageChecker::uninitRefOrPointer(
   return false;
 }
 
+namespace {
 class FindUninitializedField {
 public:
   SmallVector<const FieldDecl *, 10> FieldChain;
@@ -234,6 +235,7 @@ public:
     return false;
   }
 };
+} // namespace
 
 bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C,
                                                SVal V,
index 7c53b2d21a5c5ab4496d350b1c187d79f4871ef1..0752dba49c8a192498d90573f5337ab66366ddfc 100644 (file)
@@ -337,6 +337,7 @@ void ExprInspectionChecker::analyzerDenote(const CallExpr *CE,
   C.addTransition(C.getState()->set<DenotedSymbols>(Sym, E));
 }
 
+namespace {
 class SymbolExpressor
     : public SymExprVisitor<SymbolExpressor, Optional<std::string>> {
   ProgramStateRef State;
@@ -369,6 +370,7 @@ public:
     return None;
   }
 };
+} // namespace
 
 void ExprInspectionChecker::analyzerExpress(const CallExpr *CE,
                                             CheckerContext &C) const {
index 151865f874e5d6bc82154a6a94d58fb0e19aa583..c5edfad7413616ea866bd63eb163c6fb094ca4f3 100644 (file)
@@ -98,11 +98,12 @@ STATISTIC(NumMaxBlockCountReachedInInlined,
 STATISTIC(NumTimesRetriedWithoutInlining,
             "The # of times we re-evaluated a call without inlining");
 
-
 //===----------------------------------------------------------------------===//
 // Internal program state traits.
 //===----------------------------------------------------------------------===//
 
+namespace {
+
 // When modeling a C++ constructor, for a variety of reasons we need to track
 // the location of the object for the duration of its ConstructionContext.
 // ObjectsUnderConstruction maps statements within the construction context
@@ -164,6 +165,7 @@ public:
     return Impl < RHS.Impl;
   }
 };
+} // namespace
 
 typedef llvm::ImmutableMap<ConstructedObjectKey, SVal>
     ObjectsUnderConstructionMap;