summaryrefslogtreecommitdiffstats
path: root/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h')
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
index 8e392421fef9..0ef353bf9731 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
@@ -59,7 +59,7 @@ class CoreEngine {
friend class ExprEngine;
friend class IndirectGotoNodeBuilder;
friend class NodeBuilder;
- friend struct NodeBuilderContext;
+ friend class NodeBuilderContext;
friend class SwitchNodeBuilder;
public:
@@ -193,12 +193,12 @@ public:
DataTag::Factory &getDataTags() { return DataTags; }
};
-// TODO: Turn into a class.
-struct NodeBuilderContext {
+class NodeBuilderContext {
const CoreEngine &Eng;
const CFGBlock *Block;
const LocationContext *LC;
+public:
NodeBuilderContext(const CoreEngine &E, const CFGBlock *B,
const LocationContext *L)
: Eng(E), Block(B), LC(L) {
@@ -208,9 +208,15 @@ struct NodeBuilderContext {
NodeBuilderContext(const CoreEngine &E, const CFGBlock *B, ExplodedNode *N)
: NodeBuilderContext(E, B, N->getLocationContext()) {}
+ /// Return the CoreEngine associated with this builder.
+ const CoreEngine &getEngine() const { return Eng; }
+
/// Return the CFGBlock associated with this builder.
const CFGBlock *getBlock() const { return Block; }
+ /// Return the location context associated with this builder.
+ const LocationContext *getLocationContext() const { return LC; }
+
/// Returns the number of times the current basic block has been
/// visited on the exploded graph path.
unsigned blockCount() const {