PeiLIU via llvm-dev
2016-May-11 12:27 UTC
[llvm-dev] operation about confused Load GetElementPtr inst.
Hi, I'am confused by this Load instruction. %tmp6 = load i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), align 4, !dbg !59 I want to get the string name of Node, but how can I get that. The loadInst->getOperand(0) return like this: i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), but I don't how to cast the returned value to GetElementPtr inst(in the GetElementPtr inst it can be used to get the Node string). I am confused about it? How I can get what I want? Thank you, I am very appreciate your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160511/2954a86a/attachment.html>
Jesper Antonsson via llvm-dev
2016-May-11 13:03 UTC
[llvm-dev] operation about confused Load GetElementPtr inst.
GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); BR /j From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of PeiLIU via llvm-dev Sent: den 11 maj 2016 14:28 To: llvm-dev at lists.llvm.org Subject: [llvm-dev] operation about confused Load GetElementPtr inst. Hi, I'am confused by this Load instruction. %tmp6 = load i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), align 4, !dbg !59 I want to get the string name of Node, but how can I get that. The loadInst->getOperand(0) return like this: i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), but I don't how to cast the returned value to GetElementPtr inst(in the GetElementPtr inst it can be used to get the Node string). I am confused about it? How I can get what I want? Thank you, I am very appreciate your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160511/05c8677f/attachment.html>