search for: mygv

Displaying 2 results from an estimated 2 matches for "mygv".

Did you mean: mygl
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 back from the Constant* result? I'd like to be able to run the function. result->dump() shows the following: i32 (i32, i32)** getelementptr inbounds (%myStruct* @myGV, i32 0, i32 0)...
2012 Sep 19
0
[LLVMdev] newbie question on getelementptr
...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, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified...