Hello All, I'm not able to extract f1 from a getelementptr inbounds Instruction.
struct foo { int num; }; extern struct foo f1; void hello () { if (f1.num){ } } @f1 = external dso_local global %struct.foo, align 4 define dso_local void @hello() #0 !dbg !9 { %1 = load i32, i32* getelementptr inbounds (%struct.foo, %struct.foo* *@f1* , i32 0, i32 0), align 4, !dbg !13 %2 = icmp ne i32 %1, 0, !dbg !15 br i1 %2, label %3, label %4, !dbg !16 } Instruction*Inst = load i32, i32* getelementptr inbounds (%struct.foo, %struct.foo* @f1, i32 0, i32 0) Value *V=Inst->getOperand()[0] = i32* getelementptr inbounds (%struct.foo, %struct.foo* @f1, i32 0, i32 0) *V->getName().str() *// does not return anything. Any pointers. Thanks.
_______________________________________________ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users