diff options
author | Anna Zaks <ganna@apple.com> | 2012-08-24 01:39:10 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-08-24 01:39:10 +0000 |
commit | e54778d77d4f2b2d006bdb7e16f49271e1e9d13d (patch) | |
tree | 40f1818ac5ac1fd7cf91260185b6a66b20d7ad0d /include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | |
parent | 2c9f87ca5cccbfdaad82762368af5b2323320653 (diff) |
[analyzer] Move DynamicTypeInfo out of the ProgramState.h
(I am not sure if we should move the setters and getters as well and
make them into static methods..)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h index 522228bff8..2263eca328 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines SymbolRef, ExprBindKey, and ProgramState*. +// This file defines the state of the program along the analyzes path. // //===----------------------------------------------------------------------===// @@ -16,6 +16,7 @@ #include "clang/Basic/LLVM.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h" #include "clang/StaticAnalyzer/Core/PathSensitive/Environment.h" #include "clang/StaticAnalyzer/Core/PathSensitive/Store.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h" @@ -56,38 +57,6 @@ template <typename T> struct ProgramStateTrait { } }; -/// \class DynamicTypeInfo -/// -/// \brief Stores the currently inferred strictest bound on the runtime type -/// of a region in a given state along the analysis path. -class DynamicTypeInfo { - QualType T; - bool CanBeASubClass; - -public: - DynamicTypeInfo() : T(QualType()) {} - DynamicTypeInfo(QualType WithType, bool CanBeSub = true) - : T(WithType), CanBeASubClass(CanBeSub) {} - - /// \brief Return true if no dynamic type info is available. - bool isValid() const { return !T.isNull(); } - - /// \brief Returns the currently inferred upper bound on the runtime type. - QualType getType() const { return T; } - - /// \brief Returns false if the type T is the only type in the lattice - /// (the type information is precise), true otherwise. - bool canBeASubClass() const { return CanBeASubClass; } - - void Profile(llvm::FoldingSetNodeID &ID) const { - T.Profile(ID); - ID.AddInteger((unsigned)CanBeASubClass); - } - bool operator==(const DynamicTypeInfo &X) const { - return T == X.T && CanBeASubClass == X.CanBeASubClass; - } -}; - /// \class ProgramState /// ProgramState - This class encapsulates: /// @@ -827,7 +796,7 @@ public: bool scan(const SymExpr *sym); }; -} // end GR namespace +} // end ento namespace } // end clang namespace |