[cfe-commits] r64558 - in /cfe/trunk: Driver/AnalysisConsumer.cpp include/clang/Analysis/PathSensitive/ConstraintManager.h lib/Analysis/BasicConstraintManager.cpp lib/Analysis/RangeConstraintManager.cpp lib/Analysis/SimpleConstraintManager.cpp li

Ben Laurie benl at google.com
Sun Feb 15 06:48:34 PST 2009


On Sat, Feb 14, 2009 at 5:08 PM, Ted Kremenek <kremenek at apple.com> wrote:
> Added: cfe/trunk/lib/Analysis/SimpleConstraintManager.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SimpleConstraintManager.h?rev=64558&view=auto

You managed to add the content of this file twice somehow!

>
> ==============================================================================
> --- cfe/trunk/lib/Analysis/SimpleConstraintManager.h (added)
> +++ cfe/trunk/lib/Analysis/SimpleConstraintManager.h Sat Feb 14 11:08:39 2009
> @@ -0,0 +1,160 @@
> +//== SimpleConstraintManager.h ----------------------------------*- C++ -*--==//
> +//
> +//                     The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===----------------------------------------------------------------------===//
> +//
> +//  Code shared between BasicConstraintManager and RangeConstraintManager.
> +//
> +//===----------------------------------------------------------------------===//
> +
> +#ifndef LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H
> +#define LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H
> +
> +#include "clang/Analysis/PathSensitive/ConstraintManager.h"
> +#include "clang/Analysis/PathSensitive/GRState.h"
> +
> +namespace clang {
> +
> +class SimpleConstraintManager : public ConstraintManager {
> +protected:
> +  GRStateManager& StateMgr;
> +public:
> +  SimpleConstraintManager(GRStateManager& statemgr)
> +    : StateMgr(statemgr) {}
> +  virtual ~SimpleConstraintManager();
> +  virtual const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
> +                                bool& isFeasible);
> +
> +  const GRState* Assume(const GRState* St, Loc Cond, bool Assumption,
> +                        bool& isFeasible);
> +
> +  const GRState* AssumeAux(const GRState* St, Loc Cond,bool Assumption,
> +                           bool& isFeasible);
> +
> +  const GRState* Assume(const GRState* St, NonLoc Cond, bool Assumption,
> +                        bool& isFeasible);
> +
> +  const GRState* AssumeAux(const GRState* St, NonLoc Cond, bool Assumption,
> +                           bool& isFeasible);
> +
> +  const GRState* AssumeSymInt(const GRState* St, bool Assumption,
> +                              const SymIntConstraint& C, bool& isFeasible);
> +
> +  virtual const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymLT(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymGT(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymLE(const GRState* St, SymbolRef sym,
> +                                    const llvm::APSInt& V,
> +                                    bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymGE(const GRState* St, SymbolRef sym,
> +                                    const llvm::APSInt& V,
> +                                    bool& isFeasible) = 0;
> +
> +  const GRState* AssumeInBound(const GRState* St, SVal Idx, SVal UpperBound,
> +                               bool Assumption, bool& isFeasible);
> +
> +private:
> +  BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
> +};
> +
> +}  // end clang namespace
> +
> +#endif  // ndef LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H
> +//== SimpleConstraintManager.h ----------------------------------*- C++ -*--==//
> +//
> +//                     The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===----------------------------------------------------------------------===//
> +//
> +//  Code shared between BasicConstraintManager and RangeConstraintManager.
> +//
> +//===----------------------------------------------------------------------===//
> +
> +#ifndef LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H
> +#define LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H
> +
> +#include "clang/Analysis/PathSensitive/ConstraintManager.h"
> +#include "clang/Analysis/PathSensitive/GRState.h"
> +
> +namespace clang {
> +
> +class SimpleConstraintManager : public ConstraintManager {
> +protected:
> +  GRStateManager& StateMgr;
> +public:
> +  SimpleConstraintManager(GRStateManager& statemgr)
> +    : StateMgr(statemgr) {}
> +  virtual ~SimpleConstraintManager();
> +  virtual const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
> +                                bool& isFeasible);
> +
> +  const GRState* Assume(const GRState* St, Loc Cond, bool Assumption,
> +                        bool& isFeasible);
> +
> +  const GRState* AssumeAux(const GRState* St, Loc Cond,bool Assumption,
> +                           bool& isFeasible);
> +
> +  const GRState* Assume(const GRState* St, NonLoc Cond, bool Assumption,
> +                        bool& isFeasible);
> +
> +  const GRState* AssumeAux(const GRState* St, NonLoc Cond, bool Assumption,
> +                           bool& isFeasible);
> +
> +  const GRState* AssumeSymInt(const GRState* St, bool Assumption,
> +                              const SymIntConstraint& C, bool& isFeasible);
> +
> +  virtual const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymLT(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymGT(const GRState* St, SymbolRef sym,
> +                                     const llvm::APSInt& V,
> +                                     bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymLE(const GRState* St, SymbolRef sym,
> +                                    const llvm::APSInt& V,
> +                                    bool& isFeasible) = 0;
> +
> +  virtual const GRState* AssumeSymGE(const GRState* St, SymbolRef sym,
> +                                    const llvm::APSInt& V,
> +                                    bool& isFeasible) = 0;
> +
> +  const GRState* AssumeInBound(const GRState* St, SVal Idx, SVal UpperBound,
> +                               bool Assumption, bool& isFeasible);
> +
> +private:
> +  BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
> +};
> +
> +}  // end clang namespace
> +
> +#endif  // ndef LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H



More information about the cfe-commits mailing list