[LLVMdev] StructType opaque->sized

Rick Mann rmann at latencyzero.com
Tue Jan 22 00:04:12 PST 2013


I'm building a StructType without a body using

	StructType *StructType::create(LLVMContext &Context, StringRef Name);

and then later adding a body to with setBody(). It starts of isOpaque() == true, and isSized() == false, and after I add the body, isOpaque() == false, but isSized() is still false.

If I create a StructType using

	StructType * StructType ::create(LLVMContext &Context,
                            ArrayRef<Type*> Elements,
                            StringRef Name,
                            bool isPacked = false);

Then isOpaque() == false and isSized() == true.

Can I not make a sized struct starting with an opaque one and adding a body later?

-- 
Rick







More information about the llvm-dev mailing list