search for: isopaque

Displaying 7 results from an estimated 7 matches for "isopaque".

2013 Jan 22
2
[LLVMdev] StructType opaque->sized
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, String...
2013 Jan 22
0
[LLVMdev] StructType opaque->sized
Hi Rick, On 22/01/13 09:04, Rick Mann wrote: > 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. this is the standard way of making a struct type, so I suspect you made a mistake such as adding an opaque field to the struct (this will stop it from having a size). Ciao, Duncan. &gt...
2013 Feb 17
2
[LLVMdev] Emitting recursive types
Hi, I'm having a play with LLVM to implement a custom language (for my intellectual curiosity only). I'm wondering how, when using IRBuilder, one can can it to emit a recursive type definition? The code for TypeBuilder explicitly states that it doesn't handle recursive types... I'm after being able to emit, programmatically, stuff like the Named Types example in the Language
2012 Feb 07
0
[LLVMdev] Invalid bitcode signature
On Feb 7, 2012, at 1:29 AM, Fraser Cormack wrote: > > Sorry, I was being an idiot and was trying to link the wrong file type. Sigh. > > Now I have a problem where I merge two modules each containing the same > struct, one opaque and one defined, and it's not merging the two > consistently. I have two, let's say > > %"StructA" = type opaque >
2012 Feb 07
3
[LLVMdev] Invalid bitcode signature
Sorry, I was being an idiot and was trying to link the wrong file type. Sigh. Now I have a problem where I merge two modules each containing the same struct, one opaque and one defined, and it's not merging the two consistently. I have two, let's say %"StructA" = type opaque %"StructB" = type opaque in one module, and in the other: %"StructA" = type { i8 }
2012 Sep 19
0
[LLVMdev] newbie question on getelementptr
...ction *func_add = CreateAddFunction(module); // create a StructType to contain func_add StructType *myStructType = StructType::create(module->getContext(), "myStruct"); std::vector<Type*> fields; fields.push_back(func_add->getType()); if (myStructType->isOpaque()) { myStructType->setBody(fields, /*isPacked=*/false); } string myGVName = "myGV"; // create a GlobalVariable to store myStruct GlobalVariable* mainGV = new GlobalVariable( /*Module=*/*module, /*Type=*/myStructType, /*isConstant=*/false, /*Lin...
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function