]> granicus.if.org Git - clang/commitdiff
[analyzer] Store ValueDecl in DeclRegion
authorGeorge Karpenkov <ekarpenkov@apple.com>
Mon, 30 Jul 2018 18:57:13 +0000 (18:57 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Mon, 30 Jul 2018 18:57:13 +0000 (18:57 +0000)
All use cases of DeclRegion actually have ValueDecl there,
and getting the name from declaration comes in very handy.

Differential Revision: https://reviews.llvm.org/D49998

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338286 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h

index f3846eba6b963554381bf1536d28f02f5753c332..9bc79a8f10b20dd26cc3a2147a550ff48b2564f1 100644 (file)
@@ -897,9 +897,9 @@ public:
 
 class DeclRegion : public TypedValueRegion {
 protected:
-  const Decl *D;
+  const ValueDecl *D;
 
-  DeclRegion(const Decl *d, const MemRegion *sReg, Kind k)
+  DeclRegion(const ValueDecl *d, const MemRegion *sReg, Kind k)
       : TypedValueRegion(sReg, k), D(d) {
     assert(classof(this));
     assert(d);
@@ -909,7 +909,7 @@ protected:
                       const MemRegion* superRegion, Kind k);
 
 public:
-  const Decl *getDecl() const { return D; }
+  const ValueDecl *getDecl() const { return D; }
   void Profile(llvm::FoldingSetNodeID& ID) const override;
 
   static bool classof(const MemRegion* R) {