[midend-LoopAnalysis]为phi指令添加新的方法供外部遍历(目前不是顺序遍历)
This commit is contained in:
@@ -934,6 +934,14 @@ class PhiInst : public Instruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto& getincomings() const {return blk2val;} ///< 获取所有的基本块和对应的值
|
auto& getincomings() const {return blk2val;} ///< 获取所有的基本块和对应的值
|
||||||
|
|
||||||
|
auto getIncomingValues() const {
|
||||||
|
std::vector<std::pair<BasicBlock*, Value*>> result;
|
||||||
|
for (const auto& [block, value] : blk2val) {
|
||||||
|
result.emplace_back(block, value);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
Value* getvalfromBlk(BasicBlock* blk) const ;
|
Value* getvalfromBlk(BasicBlock* blk) const ;
|
||||||
BasicBlock* getBlkfromVal(Value* val) const ;
|
BasicBlock* getBlkfromVal(Value* val) const ;
|
||||||
|
|||||||
Reference in New Issue
Block a user