#include <stdio.h>
#include <string.h>
int main (){
unsigned short int a = 10;
if (a == 10){
//something
}
}
在LLVM传递中,我如何检测2个操作数整数比较条件语句,如上所示:(a == 10)?请让我知道我应该在LLVM api中寻找什么。
你在那里有一个ICmpInst,其操作数是整数。由于两个操作数必须具有相同的类型,因此isa<ICmpInst>(foo) && isa<IntegerType>(foo->getOperand(0))
足以识别特定指令是否是您要检测的类型。