C++ 在llvm中,什么;“类型”;函数的位广播是否在调用中?如何访问此功能?
在我的llvm IR代码中,我有以下行:C++ 在llvm中,什么;“类型”;函数的位广播是否在调用中?如何访问此功能?,c++,compiler-construction,llvm,llvm-ir,C++,Compiler Construction,Llvm,Llvm Ir,在我的llvm IR代码中,我有以下行: %tmp = call i32 @decf1(void (i8*)* bitcast (void (%a_type*)* @decf2 to void (i8*)*), i8 %x3, i8* @external_type) 我试图以编程方式提取a_类型和decf2,但似乎无法访问它们 bool runOnFunction(Function &F) override { errs() << "Initializing Test pa
%tmp = call i32 @decf1(void (i8*)* bitcast (void (%a_type*)* @decf2 to void (i8*)*), i8 %x3, i8* @external_type)
我试图以编程方式提取a_类型
和decf2
,但似乎无法访问它们
bool runOnFunction(Function &F) override {
errs() << "Initializing Test pass\n";
for (BasicBlock &BB : F) {
for (Instruction &I : BB) {
// New Instruction
errs() << "\n\n"
<< "=====================\n"
<< "- - - - - - - - - - -\n"
<< "NewInstruction:\n";
I.dump();
errs() << "\n";
// New Operands
errs() << "- - - - - - - - - - -\n"
<< "Operands:\n";
for (Use &U : I.operands()) {
errs() << "Type: ";
U->getType()->print(errs());
errs() << "\n";
errs() << "Name: " << U->getName() << "\n";
}
errs() << "\n";
}
第一个打印的操作数似乎与比特广播有关如何获取位转换及其转换的操作数/类型/函数?似乎
值::stripPointerCasts()
是将转换decf2
函数作为函数*
获取的一种方法
仍然需要详细说明如何从那里获取a_类型
=====================
- - - - - - - - - - -
NewInstruction:
%tmp = call i32 @decf1(void (i8*)* bitcast (void (%a_type*)* @decf2 to void (i8*)*), i8 %x3, i8* @external_type)
- - - - - - - - - - -
Operands:
Type: void (i8*)*
Name:
Is Instruction: No
Is Function: No
Type: i8
Name: x3
Is Instruction: Yes
%x3 = mul i8 %x2, %x2
Is Function: No
Type: i8*
Name: external_type
Is Instruction: No
Is Function: No
Type: i32 (void (i8*)*, i8, i8*)*
Name: decf1
Is Instruction: No
Is Function: Yes
Is Declaration: Yes