[cfe-commits] r158086 - in /cfe/trunk: include/clang/Sema/ include/clang/StaticAnalyzer/Core/PathSensitive/ lib/ARCMigrate/ lib/Analysis/ lib/CodeGen/ lib/Parse/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/Checkers/ lib/StaticAnalyzer/Core/

Chandler Carruth chandlerc at google.com
Wed Jun 6 10:48:12 PDT 2012


On Wed, Jun 6, 2012 at 10:32 AM, Benjamin Kramer
<benny.kra at googlemail.com>wrote:

> Author: d0k
> Date: Wed Jun  6 12:32:50 2012
> New Revision: 158086
>
> URL: http://llvm.org/viewvc/llvm-project?rev=158086&view=rev
> Log:
> Remove unused private member variables found by clang's new
> -Wunused-private-field.
>

Wow that found a lot of cruft! Nice!


>
> Modified:
>    cfe/trunk/include/clang/Sema/Designator.h
>
>  cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
>    cfe/trunk/lib/ARCMigrate/ARCMT.cpp
>    cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp
>    cfe/trunk/lib/ARCMigrate/TransGCCalls.cpp
>    cfe/trunk/lib/Analysis/CallGraph.cpp
>    cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
>    cfe/trunk/lib/CodeGen/CodeGenTBAA.h
>    cfe/trunk/lib/Parse/ParsePragma.h
>    cfe/trunk/lib/Parse/Parser.cpp
>    cfe/trunk/lib/Sema/SemaStmt.cpp
>    cfe/trunk/lib/Serialization/ASTReader.cpp
>    cfe/trunk/lib/Serialization/ASTWriter.cpp
>    cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
>    cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
>    cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
>    cfe/trunk/lib/StaticAnalyzer/Core/AnalysisManager.cpp
>
> Modified: cfe/trunk/include/clang/Sema/Designator.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Designator.h?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/Designator.h (original)
> +++ cfe/trunk/include/clang/Sema/Designator.h Wed Jun  6 12:32:50 2012
> @@ -179,18 +179,10 @@
>  /// Designation - Represent a full designation, which is a sequence of
>  /// designators.  This class is mostly a helper for InitListDesignations.
>  class Designation {
> -  /// InitIndex - The index of the initializer expression this is for.
>  For
> -  /// example, if the initializer were "{ A, .foo=B, C }" a Designation
> would
> -  /// exist with InitIndex=1, because element #1 has a designation.
> -  unsigned InitIndex;
> -
>   /// Designators - The actual designators for this initializer.
>   SmallVector<Designator, 2> Designators;
>
> -  Designation(unsigned Idx) : InitIndex(Idx) {}
>  public:
> -  Designation() : InitIndex(4000) {}
> -
>   /// AddDesignator - Add a designator to the end of this list.
>   void AddDesignator(Designator D) {
>     Designators.push_back(D);
>
> Modified:
> cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> ---
> cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
> (original)
> +++
> cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
> Wed Jun  6 12:32:50 2012
> @@ -41,8 +41,6 @@
>
>   CheckerManager *CheckerMgr;
>
> -  enum AnalysisScope { ScopeTU, ScopeDecl } AScope;
> -
>   /// \brief The maximum number of exploded nodes the analyzer will
> generate.
>   unsigned MaxNodes;
>
>
> Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
> +++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Wed Jun  6 12:32:50 2012
> @@ -480,13 +480,12 @@
>
>  class RewritesApplicator : public TransformActions::RewriteReceiver {
>   Rewriter &rewriter;
> -  ASTContext &Ctx;
>   MigrationProcess::RewriteListener *Listener;
>
>  public:
>   RewritesApplicator(Rewriter &rewriter, ASTContext &ctx,
>                      MigrationProcess::RewriteListener *listener)
> -    : rewriter(rewriter), Ctx(ctx), Listener(listener) {
> +    : rewriter(rewriter), Listener(listener) {
>     if (Listener)
>       Listener->start(ctx);
>   }
>
> Modified: cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp (original)
> +++ cfe/trunk/lib/ARCMigrate/TransBlockObjCVariable.cpp Wed Jun  6
> 12:32:50 2012
> @@ -37,7 +37,6 @@
>
>  class RootBlockObjCVarRewriter :
>                           public
> RecursiveASTVisitor<RootBlockObjCVarRewriter> {
> -  MigrationPass &Pass;
>   llvm::DenseSet<VarDecl *> &VarsToChange;
>
>   class BlockVarChecker : public RecursiveASTVisitor<BlockVarChecker> {
> @@ -71,9 +70,8 @@
>   };
>
>  public:
> -  RootBlockObjCVarRewriter(MigrationPass &pass,
> -                           llvm::DenseSet<VarDecl *> &VarsToChange)
> -    : Pass(pass), VarsToChange(VarsToChange) { }
> +  RootBlockObjCVarRewriter(llvm::DenseSet<VarDecl *> &VarsToChange)
> +    : VarsToChange(VarsToChange) { }
>
>   bool VisitBlockDecl(BlockDecl *block) {
>     SmallVector<VarDecl *, 4> BlockVars;
> @@ -120,7 +118,7 @@
>     : Pass(pass), VarsToChange(VarsToChange) { }
>
>   bool TraverseBlockDecl(BlockDecl *block) {
> -    RootBlockObjCVarRewriter(Pass, VarsToChange).TraverseDecl(block);
> +    RootBlockObjCVarRewriter(VarsToChange).TraverseDecl(block);
>     return true;
>   }
>  };
>
> Modified: cfe/trunk/lib/ARCMigrate/TransGCCalls.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/TransGCCalls.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/ARCMigrate/TransGCCalls.cpp (original)
> +++ cfe/trunk/lib/ARCMigrate/TransGCCalls.cpp Wed Jun  6 12:32:50 2012
> @@ -20,13 +20,12 @@
>  class GCCollectableCallsChecker :
>                          public
> RecursiveASTVisitor<GCCollectableCallsChecker> {
>   MigrationContext &MigrateCtx;
> -  ParentMap &PMap;
>   IdentifierInfo *NSMakeCollectableII;
>   IdentifierInfo *CFMakeCollectableII;
>
>  public:
> -  GCCollectableCallsChecker(MigrationContext &ctx, ParentMap &map)
> -    : MigrateCtx(ctx), PMap(map) {
> +  GCCollectableCallsChecker(MigrationContext &ctx)
> +    : MigrateCtx(ctx) {
>     IdentifierTable &Ids = MigrateCtx.Pass.Ctx.Idents;
>     NSMakeCollectableII = &Ids.get("NSMakeCollectable");
>     CFMakeCollectableII = &Ids.get("CFMakeCollectable");
> @@ -78,7 +77,6 @@
>  } // anonymous namespace
>
>  void GCCollectableCallsTraverser::traverseBody(BodyContext &BodyCtx) {
> -  GCCollectableCallsChecker(BodyCtx.getMigrationContext(),
> -                            BodyCtx.getParentMap())
> +  GCCollectableCallsChecker(BodyCtx.getMigrationContext())
>
> .TraverseStmt(BodyCtx.getTopStmt());
>  }
>
> Modified: cfe/trunk/lib/Analysis/CallGraph.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CallGraph.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Analysis/CallGraph.cpp (original)
> +++ cfe/trunk/lib/Analysis/CallGraph.cpp Wed Jun  6 12:32:50 2012
> @@ -25,12 +25,11 @@
>  /// given function body.
>  class CGBuilder : public StmtVisitor<CGBuilder> {
>   CallGraph *G;
> -  const Decl *FD;
>   CallGraphNode *CallerNode;
>
>  public:
> -  CGBuilder(CallGraph *g, const Decl *D, CallGraphNode *N)
> -    : G(g), FD(D), CallerNode(N) {}
> +  CGBuilder(CallGraph *g, CallGraphNode *N)
> +    : G(g), CallerNode(N) {}
>
>   void VisitStmt(Stmt *S) { VisitChildren(S); }
>
> @@ -99,7 +98,7 @@
>     Root->addCallee(Node, this);
>
>   // Process all the calls by this function as well.
> -  CGBuilder builder(this, D, Node);
> +  CGBuilder builder(this, Node);
>   if (Stmt *Body = D->getBody())
>     builder.Visit(Body);
>  }
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp Wed Jun  6 12:32:50 2012
> @@ -29,8 +29,7 @@
>  CodeGenTBAA::CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext& VMContext,
>                          const CodeGenOptions &CGO,
>                          const LangOptions &Features, MangleContext
> &MContext)
> -  : Context(Ctx), VMContext(VMContext), CodeGenOpts(CGO),
> -    Features(Features), MContext(MContext),
> +  : Context(Ctx), CodeGenOpts(CGO), Features(Features),
> MContext(MContext),
>     MDHelper(VMContext), Root(0), Char(0) {
>  }
>
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenTBAA.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTBAA.h?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenTBAA.h (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenTBAA.h Wed Jun  6 12:32:50 2012
> @@ -39,7 +39,6 @@
>  /// while lowering AST types to LLVM types.
>  class CodeGenTBAA {
>   ASTContext &Context;
> -  llvm::LLVMContext& VMContext;
>   const CodeGenOptions &CodeGenOpts;
>   const LangOptions &Features;
>   MangleContext &MContext;
>
> Modified: cfe/trunk/lib/Parse/ParsePragma.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.h?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParsePragma.h (original)
> +++ cfe/trunk/lib/Parse/ParsePragma.h Wed Jun  6 12:32:50 2012
> @@ -30,10 +30,9 @@
>  };
>
>  class PragmaGCCVisibilityHandler : public PragmaHandler {
> -  Sema &Actions;
>  public:
> -  explicit PragmaGCCVisibilityHandler(Sema &A) :
> PragmaHandler("visibility"),
> -                                                 Actions(A) {}
> +  explicit PragmaGCCVisibilityHandler(Sema &/*A*/)
> +    : PragmaHandler("visibility") {}
>
>   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind
> Introducer,
>                             Token &FirstToken);
> @@ -70,11 +69,9 @@
>  };
>
>  class PragmaUnusedHandler : public PragmaHandler {
> -  Sema &Actions;
> -  Parser &parser;
>  public:
> -  PragmaUnusedHandler(Sema &A, Parser& p)
> -    : PragmaHandler("unused"), Actions(A), parser(p) {}
> +  PragmaUnusedHandler(Sema &/*A*/)
> +    : PragmaHandler("unused") {}
>
>   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind
> Introducer,
>                             Token &FirstToken);
> @@ -102,10 +99,9 @@
>
>  class PragmaOpenCLExtensionHandler : public PragmaHandler {
>   Sema &Actions;
> -  Parser &parser;
>  public:
> -  PragmaOpenCLExtensionHandler(Sema &S, Parser& p) :
> -    PragmaHandler("EXTENSION"), Actions(S), parser(p) {}
> +  PragmaOpenCLExtensionHandler(Sema &A) :
> +    PragmaHandler("EXTENSION"), Actions(A) {}
>   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind
> Introducer,
>                             Token &FirstToken);
>  };
> @@ -113,10 +109,9 @@
>
>  class PragmaFPContractHandler : public PragmaHandler {
>   Sema &Actions;
> -  Parser &parser;
>  public:
> -  PragmaFPContractHandler(Sema &S, Parser& p) :
> -    PragmaHandler("FP_CONTRACT"), Actions(S), parser(p) {}
> +  PragmaFPContractHandler(Sema &A) :
> +    PragmaHandler("FP_CONTRACT"), Actions(A) {}
>   virtual void HandlePragma(Preprocessor &PP, PragmaIntroducerKind
> Introducer,
>                             Token &FirstToken);
>  };
>
> Modified: cfe/trunk/lib/Parse/Parser.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Parse/Parser.cpp (original)
> +++ cfe/trunk/lib/Parse/Parser.cpp Wed Jun  6 12:32:50 2012
> @@ -59,7 +59,7 @@
>   MSStructHandler.reset(new PragmaMSStructHandler(actions));
>   PP.AddPragmaHandler(MSStructHandler.get());
>
> -  UnusedHandler.reset(new PragmaUnusedHandler(actions, *this));
> +  UnusedHandler.reset(new PragmaUnusedHandler(actions));
>   PP.AddPragmaHandler(UnusedHandler.get());
>
>   WeakHandler.reset(new PragmaWeakHandler(actions));
> @@ -68,12 +68,11 @@
>   RedefineExtnameHandler.reset(new PragmaRedefineExtnameHandler(actions));
>   PP.AddPragmaHandler(RedefineExtnameHandler.get());
>
> -  FPContractHandler.reset(new PragmaFPContractHandler(actions, *this));
> +  FPContractHandler.reset(new PragmaFPContractHandler(actions));
>   PP.AddPragmaHandler("STDC", FPContractHandler.get());
>
>   if (getLangOpts().OpenCL) {
> -    OpenCLExtensionHandler.reset(
> -                  new PragmaOpenCLExtensionHandler(actions, *this));
> +    OpenCLExtensionHandler.reset(new
> PragmaOpenCLExtensionHandler(actions));
>     PP.AddPragmaHandler("OPENCL", OpenCLExtensionHandler.get());
>
>     PP.AddPragmaHandler("OPENCL", FPContractHandler.get());
>
> Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaStmt.cpp Wed Jun  6 12:32:50 2012
> @@ -1116,18 +1116,15 @@
>     llvm::SmallPtrSet<VarDecl*, 8> &Decls;
>     llvm::SmallVector<SourceRange, 10> &Ranges;
>     bool Simple;
> -    PartialDiagnostic &PDiag;
>  public:
>   typedef EvaluatedExprVisitor<DeclExtractor> Inherited;
>
>   DeclExtractor(Sema &S, llvm::SmallPtrSet<VarDecl*, 8> &Decls,
> -                llvm::SmallVector<SourceRange, 10> &Ranges,
> -                PartialDiagnostic &PDiag) :
> +                llvm::SmallVector<SourceRange, 10> &Ranges) :
>       Inherited(S.Context),
>       Decls(Decls),
>       Ranges(Ranges),
> -      Simple(true),
> -      PDiag(PDiag) {}
> +      Simple(true) {}
>
>   bool isSimple() { return Simple; }
>
> @@ -1274,7 +1271,7 @@
>     PartialDiagnostic PDiag =
> S.PDiag(diag::warn_variables_not_in_loop_body);
>     llvm::SmallPtrSet<VarDecl*, 8> Decls;
>     llvm::SmallVector<SourceRange, 10> Ranges;
> -    DeclExtractor DE(S, Decls, Ranges, PDiag);
> +    DeclExtractor DE(S, Decls, Ranges);
>     DE.Visit(Second);
>
>     // Don't analyze complex conditionals.
>
> Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Jun  6 12:32:50 2012
> @@ -4144,7 +4144,6 @@
>  class clang::TypeLocReader : public TypeLocVisitor<TypeLocReader> {
>   ASTReader &Reader;
>   ModuleFile &F;
> -  llvm::BitstreamCursor &DeclsCursor;
>   const ASTReader::RecordData &Record;
>   unsigned &Idx;
>
> @@ -4161,7 +4160,7 @@
>  public:
>   TypeLocReader(ASTReader &Reader, ModuleFile &F,
>                 const ASTReader::RecordData &Record, unsigned &Idx)
> -    : Reader(Reader), F(F), DeclsCursor(F.DeclsCursor), Record(Record),
> Idx(Idx)
> +    : Reader(Reader), F(F), Record(Record), Idx(Idx)
>   { }
>
>   // We want compile-time assurance that we've enumerated all of
> @@ -4859,7 +4858,6 @@
>   class DeclContextNameLookupVisitor {
>     ASTReader &Reader;
>     llvm::SmallVectorImpl<const DeclContext *> &Contexts;
> -    const DeclContext *DC;
>     DeclarationName Name;
>     SmallVectorImpl<NamedDecl *> &Decls;
>
> @@ -4961,7 +4959,6 @@
>   class DeclContextAllNamesVisitor {
>     ASTReader &Reader;
>     llvm::SmallVectorImpl<const DeclContext *> &Contexts;
> -    const DeclContext *DC;
>     llvm::DenseMap<DeclarationName, SmallVector<NamedDecl *, 8> > &Decls;
>
>   public:
>
> Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Jun  6 12:32:50 2012
> @@ -1242,15 +1242,14 @@
>   // Trait used for the on-disk hash table of header search information.
>   class HeaderFileInfoTrait {
>     ASTWriter &Writer;
> -    const HeaderSearch &HS;
>
>     // Keep track of the framework names we've used during serialization.
>     SmallVector<char, 128> FrameworkStringData;
>     llvm::StringMap<unsigned> FrameworkNameOffset;
>
>   public:
> -    HeaderFileInfoTrait(ASTWriter &Writer, const HeaderSearch &HS)
> -      : Writer(Writer), HS(HS) { }
> +    HeaderFileInfoTrait(ASTWriter &Writer)
> +      : Writer(Writer) { }
>
>     typedef const char *key_type;
>     typedef key_type key_type_ref;
> @@ -1335,7 +1334,7 @@
>   if (FilesByUID.size() > HS.header_file_size())
>     FilesByUID.resize(HS.header_file_size());
>
> -  HeaderFileInfoTrait GeneratorTrait(*this, HS);
> +  HeaderFileInfoTrait GeneratorTrait(*this);
>   OnDiskChainedHashTableGenerator<HeaderFileInfoTrait> Generator;
>   SmallVector<const char *, 4> SavedStrings;
>   unsigned NumHeaderSearchEntries = 0;
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
> (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp Wed
> Jun  6 12:32:50 2012
> @@ -128,14 +128,13 @@
>     public:
>       SmallVector<const FieldDecl *, 10> FieldChain;
>     private:
> -      ASTContext &C;
>       StoreManager &StoreMgr;
>       MemRegionManager &MrMgr;
>       Store store;
>     public:
> -      FindUninitializedField(ASTContext &c, StoreManager &storeMgr,
> +      FindUninitializedField(StoreManager &storeMgr,
>                              MemRegionManager &mrMgr, Store s)
> -      : C(c), StoreMgr(storeMgr), MrMgr(mrMgr), store(s) {}
> +      : StoreMgr(storeMgr), MrMgr(mrMgr), store(s) {}
>
>       bool Find(const TypedValueRegion *R) {
>         QualType T = R->getValueType();
> @@ -165,8 +164,7 @@
>     };
>
>     const LazyCompoundValData *D = LV->getCVData();
> -    FindUninitializedField F(C.getASTContext(),
> -
> C.getState()->getStateManager().getStoreManager(),
> +    FindUninitializedField
> F(C.getState()->getStateManager().getStoreManager(),
>                              C.getSValBuilder().getRegionManager(),
>                              D->getStore());
>
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Wed Jun
>  6 12:32:50 2012
> @@ -1700,32 +1700,18 @@
>   };
>
>   class Leak : public CFRefBug {
> -    const bool isReturn;
> -  protected:
> -    Leak(StringRef name, bool isRet)
> -    : CFRefBug(name), isReturn(isRet) {
> +  public:
> +    Leak(StringRef name)
> +    : CFRefBug(name) {
>       // Leaks should not be reported if they are post-dominated by a sink.
>       setSuppressOnSink(true);
>     }
> -  public:
>
>     const char *getDescription() const { return ""; }
>
>     bool isLeak() const { return true; }
>   };
>
> -  class LeakAtReturn : public Leak {
> -  public:
> -    LeakAtReturn(StringRef name)
> -    : Leak(name, true) {}
> -  };
> -
> -  class LeakWithinFunction : public Leak {
> -  public:
> -    LeakWithinFunction(StringRef name)
> -    : Leak(name, false) {}
> -  };
> -
>   //===---------===//
>   // Bug Reports.  //
>   //===---------===//
> @@ -2420,20 +2406,17 @@
>                                      bool GCEnabled) const {
>     if (GCEnabled) {
>       if (!leakWithinFunctionGC)
> -        leakWithinFunctionGC.reset(new LeakWithinFunction("Leak of object
> when "
> -                                                          "using garbage "
> -                                                          "collection"));
> +        leakWithinFunctionGC.reset(new Leak("Leak of object when using "
> +                                             "garbage collection"));
>       return leakWithinFunctionGC.get();
>     } else {
>       if (!leakWithinFunction) {
>         if (LOpts.getGC() == LangOptions::HybridGC) {
> -          leakWithinFunction.reset(new LeakWithinFunction("Leak of object
> when "
> -                                                          "not using
> garbage "
> -                                                          "collection
> (GC) in "
> -                                                          "dual GC/non-GC
> "
> -                                                          "code"));
> +          leakWithinFunction.reset(new Leak("Leak of object when not
> using "
> +                                            "garbage collection (GC) in "
> +                                            "dual GC/non-GC code"));
>         } else {
> -          leakWithinFunction.reset(new LeakWithinFunction("Leak"));
> +          leakWithinFunction.reset(new Leak("Leak"));
>         }
>       }
>       return leakWithinFunction.get();
> @@ -2443,17 +2426,17 @@
>   CFRefBug *getLeakAtReturnBug(const LangOptions &LOpts, bool GCEnabled)
> const {
>     if (GCEnabled) {
>       if (!leakAtReturnGC)
> -        leakAtReturnGC.reset(new LeakAtReturn("Leak of returned object
> when "
> -                                              "using garbage
> collection"));
> +        leakAtReturnGC.reset(new Leak("Leak of returned object when using
> "
> +                                      "garbage collection"));
>       return leakAtReturnGC.get();
>     } else {
>       if (!leakAtReturn) {
>         if (LOpts.getGC() == LangOptions::HybridGC) {
> -          leakAtReturn.reset(new LeakAtReturn("Leak of returned object
> when "
> -                                              "not using garbage
> collection "
> -                                              "(GC) in dual GC/non-GC
> code"));
> +          leakAtReturn.reset(new Leak("Leak of returned object when not
> using "
> +                                      "garbage collection (GC) in dual "
> +                                      "GC/non-GC code"));
>         } else {
> -          leakAtReturn.reset(new LeakAtReturn("Leak of returned object"));
> +          leakAtReturn.reset(new Leak("Leak of returned object"));
>         }
>       }
>       return leakAtReturn.get();
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp Wed Jun
>  6 12:32:50 2012
> @@ -46,7 +46,7 @@
>                                 visited. */
>               PostVisited  /**< A CallExpr to this FunctionDecl is in the
>                                 worklist, and the body has been visited. */
> -  } K;
> +  };
>
>   /// A DenseMap that records visited states of FunctionDecls.
>   llvm::DenseMap<const FunctionDecl *, Kind> VisitedFunctions;
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Core/AnalysisManager.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/AnalysisManager.cpp?rev=158086&r1=158085&r2=158086&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Core/AnalysisManager.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Core/AnalysisManager.cpp Wed Jun  6
> 12:32:50 2012
> @@ -36,7 +36,7 @@
>     Ctx(ctx), Diags(diags), LangOpts(lang), PD(pd),
>     CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
>     CheckerMgr(checkerMgr),
> -    AScope(ScopeDecl), MaxNodes(maxnodes), MaxVisit(maxvisit),
> +    MaxNodes(maxnodes), MaxVisit(maxvisit),
>     VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge),
>     EagerlyAssume(eager), TrimGraph(trim),
>     EagerlyTrimEGraph(eagerlyTrimEGraph),
> @@ -59,7 +59,6 @@
>     CreateStoreMgr(ParentAM.CreateStoreMgr),
>     CreateConstraintMgr(ParentAM.CreateConstraintMgr),
>     CheckerMgr(ParentAM.CheckerMgr),
> -    AScope(ScopeDecl),
>     MaxNodes(ParentAM.MaxNodes),
>     MaxVisit(ParentAM.MaxVisit),
>     VisualizeEGDot(ParentAM.VisualizeEGDot),
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120606/754c3df3/attachment.html>


More information about the cfe-commits mailing list