This revision was automatically updated to reflect the committed changes.
Closed by commit rL286306: [analyzer] Provide Contains() on ImmutableMap
program state partial trait. (authored by ddcc).
Changed prior to commit:
https://reviews.llvm.org/D26373?vs=77109&id=77269#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26373
Files:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
Index:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
===================================================================
---
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
+++
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file defines partial implementations of template specializations of
-// the class ProgramStateTrait<>. ProgramStateTrait<> is used by
ProgramState
+// the class ProgramStateTrait<>. ProgramStateTrait<> is used by ProgramState
// to implement set/get methods for manipulating a ProgramState's
// generic data map.
//
@@ -81,6 +81,10 @@
return F.remove(B, K);
}
+ static bool Contains(data_type B, key_type K) {
+ return B.contains(K);
+ }
+
static inline context_type MakeContext(void *p) {
return *((typename data_type::Factory*) p);
}
@@ -185,7 +189,7 @@
}
};
-
+
// Partial specialization for bool.
template <> struct ProgramStatePartialTrait<bool> {
typedef bool data_type;
@@ -198,7 +202,7 @@
return (void*) (uintptr_t) d;
}
};
-
+
// Partial specialization for unsigned.
template <> struct ProgramStatePartialTrait<unsigned> {
typedef unsigned data_type;
Index: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
===================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file defines partial implementations of template specializations of
-// the class ProgramStateTrait<>. ProgramStateTrait<> is used by ProgramState
+// the class ProgramStateTrait<>. ProgramStateTrait<> is used by ProgramState
// to implement set/get methods for manipulating a ProgramState's
// generic data map.
//
@@ -81,6 +81,10 @@
return F.remove(B, K);
}
+ static bool Contains(data_type B, key_type K) {
+ return B.contains(K);
+ }
+
static inline context_type MakeContext(void *p) {
return *((typename data_type::Factory*) p);
}
@@ -185,7 +189,7 @@
}
};
-
+
// Partial specialization for bool.
template <> struct ProgramStatePartialTrait<bool> {
typedef bool data_type;
@@ -198,7 +202,7 @@
return (void*) (uintptr_t) d;
}
};
-
+
// Partial specialization for unsigned.
template <> struct ProgramStatePartialTrait<unsigned> {
typedef unsigned data_type;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits