[LLVMdev] Defining/Accessing Structs Dynamically

Nyx mcheva at cs.mcgill.ca
Thu Jun 11 19:51:09 PDT 2009


I have most of the code working but I'm running into two issues:

1. I'm not sure exactly how to return a structure on the stack. Right now,
I'm allocating one with alloca, but it seems I can only return a pointer to
it, not the structure itself. Is there any way to dereference the pointer?

2. On the calling side, I get a structure as a return value. However, it
seems GEP is complaining (I get an assertion failure) that I can't do GEP on
a structure object that isn't a pointer. How do I get a pointer to this
return value?

Right now, as a potential solution, I'm actually considering allocating the
structure on the calling side and passing a pointer to it instead, but
perhaps there's a better way to go about this.

- Max
-- 
View this message in context: http://www.nabble.com/Defining-Accessing-Structs-Dynamically-tp23966736p23992064.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list