From: Ted Kremenek Date: Fri, 25 Jan 2008 23:43:12 +0000 (+0000) Subject: Further refactoring of transfer functions by having APSIntSetOp take X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc1c3654229e9adfcdb90551375aeac00e338bd7;p=clang Further refactoring of transfer functions by having APSIntSetOp take a template-template parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46378 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp index db897b4512..69a0d93207 100644 --- a/Analysis/GRConstants.cpp +++ b/Analysis/GRConstants.cpp @@ -50,23 +50,26 @@ namespace { class VISIBILITY_HIDDEN ValueKey { uintptr_t Raw; + + void operator=(const ValueKey& RHS); // Do not implement. public: enum Kind { IsSubExpr=0x0, IsBlkExpr=0x1, IsDecl=0x2, Flags=0x3 }; inline void* getPtr() const { return reinterpret_cast(Raw & ~Flags); } inline Kind getKind() const { return (Kind) (Raw & Flags); } ValueKey(const ValueDecl* VD) - : Raw(reinterpret_cast(VD) | IsDecl) {} + : Raw(reinterpret_cast(VD) | IsDecl) { assert(VD); } ValueKey(Stmt* S, bool isBlkExpr = false) - : Raw(reinterpret_cast(S) | isBlkExpr ? IsBlkExpr : IsSubExpr) {} + : Raw(reinterpret_cast(S) | (isBlkExpr ? IsBlkExpr : IsSubExpr)){ + assert(S); + } bool isSubExpr() const { return getKind() == IsSubExpr; } bool isDecl() const { return getKind() == IsDecl; } inline void Profile(llvm::FoldingSetNodeID& ID) const { ID.AddPointer(getPtr()); - ID.AddInteger((unsigned) getKind()); } inline bool operator==(const ValueKey& X) const { @@ -146,16 +149,17 @@ public: }; } // end anonymous namespace -template +template