mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-30 17:21:10 +00:00
Add null checks and const-ify these accessors.
llvm-svn: 36270
This commit is contained in:
parent
aac115a8e5
commit
7a5136d8c5
@ -322,13 +322,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Return the immediate dominator of A.
|
/// Return the immediate dominator of A.
|
||||||
BasicBlock *getIDom(BasicBlock *A) {
|
BasicBlock *getIDom(BasicBlock *A) const {
|
||||||
|
if (!A) return 0;
|
||||||
|
|
||||||
ETNode *NodeA = getNode(A);
|
ETNode *NodeA = getNode(A);
|
||||||
const ETNode *idom = NodeA->getFather();
|
const ETNode *idom = NodeA->getFather();
|
||||||
return idom ? idom->getData<BasicBlock>() : 0;
|
return idom ? idom->getData<BasicBlock>() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getChildren(BasicBlock *A, std::vector<BasicBlock*>& children) {
|
void getChildren(BasicBlock *A, std::vector<BasicBlock*>& children) const {
|
||||||
|
if (!A) return;
|
||||||
ETNode *NodeA = getNode(A);
|
ETNode *NodeA = getNode(A);
|
||||||
const ETNode* son = NodeA->getSon();
|
const ETNode* son = NodeA->getSon();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user