在 LLVM 中,我如何生成直接跳转的分支指令,而不是使用 if-else。我知道有 LLVM::BranchInst 类,但不知道如何为此目的使用它,或者我是否需要使用其他类?
最佳答案
你需要一个无条件分支:
static BranchInst * llvm::BranchInst::Create(BasicBlock *IfTrue,
Instruction *InsertBefore = 0)
static BranchInst * llvm::BranchInst::Create(BasicBlock *IfTrue,
BasicBlock *InsertAtEnd)
关于c++ - LLVM中直接跳转的分支指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13307711/