[cfe-dev] Parse a Value of Struct Type to extract the item type

Mustakimur Rahman Khandaker (Mustakim) via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 25 14:08:35 PDT 2018


Hello

I am working on clang codegen module to parse some information in compile time. So, here is an example LLVM Value:
{ i64, i64 } { i64 ptrtoint (void (%class.Testpm*)* @_ZN6Testpm7m_func1Ev to i64), i64 0 }
I want to parse this Value so that I can check the source type using in ptrtoint casting instruction (i.e. void (%class.Testpm*)*). I have tried following:
if (isa<llvm::PtrToIntInst>(Val)) {
llvm::IntToPtrInst *iptr = dyn_cast<llvm::PtrToIntInst>(Val);
}

but it is not working. Any idea?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180925/2aebdff4/attachment.html>


More information about the cfe-dev mailing list