LLVM

LLVM的Use-Def获取

2019-03-15  本文已影响0人  HaoMengHIT

Alternatively, it’s common to have an instance of the User Class and need to know what Values are used by it. The list of all Values used by a User is known as a use-def chain. Instances of class Instruction are common User s, so we might want to iterate over all of the values that a particular instruction uses (that is, the operands of the particular Instruction):

Instruction *pi = ...;
 
for (Use &U : pi->operands()) {
  Value *v = U.get();
  // ...
}

上一篇 下一篇

猜你喜欢

热点阅读