зеркало из https://github.com/microsoft/clang-1.git
Make BlockEntrace program points taggable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cbc8c791fd
Коммит
ab422d17dc
|
@ -539,7 +539,9 @@ public:
|
||||||
return getBlockCounter().getNumVisited(B.getBlockID());
|
return getBlockCounter().getNumVisited(B.getBlockID());
|
||||||
}
|
}
|
||||||
|
|
||||||
ExplodedNodeImpl* generateNodeImpl(const void* State);
|
ExplodedNodeImpl* generateNodeImpl(const void* State,
|
||||||
|
const void *tag = 0,
|
||||||
|
ExplodedNodeImpl *P = 0);
|
||||||
|
|
||||||
CFGBlock* getBlock() const { return &B; }
|
CFGBlock* getBlock() const { return &B; }
|
||||||
};
|
};
|
||||||
|
@ -571,9 +573,13 @@ public:
|
||||||
return getPredecessor()->getState();
|
return getPredecessor()->getState();
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeTy* MakeNode(const StateTy* St) {
|
NodeTy* MakeNode(const StateTy* St, const void *tag = 0) {
|
||||||
return static_cast<NodeTy*>(NB.generateNodeImpl(St));
|
return static_cast<NodeTy*>(NB.generateNodeImpl(St, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NodeTy *generateNode(const StateTy *St, NodeTy *Pred, const void *tag = 0) {
|
||||||
|
return static_cast<NodeTy*>(NB.generateNodeImpl(St, tag, Pred));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,8 @@ public:
|
||||||
|
|
||||||
class BlockEntrance : public ProgramPoint {
|
class BlockEntrance : public ProgramPoint {
|
||||||
public:
|
public:
|
||||||
BlockEntrance(const CFGBlock* B) : ProgramPoint(B, BlockEntranceKind) {}
|
BlockEntrance(const CFGBlock* B, const void *tag = 0)
|
||||||
|
: ProgramPoint(B, BlockEntranceKind, tag) {}
|
||||||
|
|
||||||
CFGBlock* getBlock() const {
|
CFGBlock* getBlock() const {
|
||||||
return reinterpret_cast<CFGBlock*>(getData1NoMask());
|
return reinterpret_cast<CFGBlock*>(getData1NoMask());
|
||||||
|
|
|
@ -555,16 +555,17 @@ GREndPathNodeBuilderImpl::~GREndPathNodeBuilderImpl() {
|
||||||
if (!HasGeneratedNode) generateNodeImpl(Pred->State);
|
if (!HasGeneratedNode) generateNodeImpl(Pred->State);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExplodedNodeImpl* GREndPathNodeBuilderImpl::generateNodeImpl(const void* State){
|
ExplodedNodeImpl*
|
||||||
HasGeneratedNode = true;
|
GREndPathNodeBuilderImpl::generateNodeImpl(const void* State,
|
||||||
|
const void *tag,
|
||||||
|
ExplodedNodeImpl* P) {
|
||||||
|
HasGeneratedNode = true;
|
||||||
bool IsNew;
|
bool IsNew;
|
||||||
|
|
||||||
ExplodedNodeImpl* Node =
|
ExplodedNodeImpl* Node =
|
||||||
Eng.G->getNodeImpl(BlockEntrance(&B), State, &IsNew);
|
Eng.G->getNodeImpl(BlockEntrance(&B, tag), State, &IsNew);
|
||||||
|
|
||||||
|
Node->addPredecessor(P ? P : Pred);
|
||||||
Node->addPredecessor(Pred);
|
|
||||||
|
|
||||||
if (IsNew) {
|
if (IsNew) {
|
||||||
Node->markAsSink();
|
Node->markAsSink();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче