[LLVMdev] Adding fields in a already built type?

Chris Lattner clattner at apple.com
Mon Jun 14 13:32:35 PDT 2010

On Jun 14, 2010, at 1:22 PM, St├ęphane Letz wrote:

> Hi,
> We build a type with StructType::get(fModule->getContext(), fDspFields, false); with a fDspFields  (std::vector<const llvm::Type*> fDspFields;)  that is not yet completely known when we have to build the type. It is possible to add fields in a already build type? 

Nope, types are immutable once created.  The only thing you can do is "refine" opaque types to other types.  There is a section in the programmer's manual on this:


More information about the llvm-dev mailing list