search for: blockitems

Displaying 4 results from an estimated 4 matches for "blockitems".

2019 Feb 22
2
Create the GlobalVariable which have extern in one header file
.... I already have an extern for that global in a header file to use it in the following way extern const void* DATA_TABLE[]; And with a LLVM PASS, I am trying to create this array with the same name and with initializer. So, I have following: GlobalVariable *gvar_data = new GlobalVariable( M, blockItems->getType(), true, GlobalValue::CommonLinkage, blockItems, "DATA_TABLE"); gvar_data->setAlignment(16); gvar_data->setSection("data_section"); gvar_data->addAttribute(llvm::Attribute::OptimizeNone); I am not sure if I am using the correct Linkage or not. The pass...
2019 Jan 29
2
[cfe-dev] Create a BlockAddress array from LLVM Pass
...way: unsigned int nBr = fit->second.size(); llvm::Constant *listBA[nBr]; unsigned int Idx = 0; for (std::set<llvm::BasicBlock *>::iterator it = fit->second.begin(); it != fit->second.end(); ++it) { BlockAddress *bba = BlockAddress::get(fn, *it); listBA[Idx] = bba; Idx++; } Constant *blockItems = ConstantArray::get(ArrayType::get(?, 8), listBA); Thanks On Jan 28 2019, at 3:34 pm, Eli Friedman <efriedma at quicinc.com> wrote: > Please don’t send questions to both cfe-dev and llvm-dev; usually one or the other is more appropriate (in this case, it’s llvm-dev, since there’s no clan...
2019 Jan 28
2
Create a BlockAddress array from LLVM Pass
...balVariable *gvar_ptr_abc = new GlobalVariable( /*Module=*/*fn->getParent(), /*Type=*/PointerTy, /*isConstant=*/false, /*Linkage=*/GlobalValue::InternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"labelTracker"); gvar_ptr_abc->setAlignment(16); Constant *blockItems = ConstantDataArray::get(fn->getContext(), tmp); gvar_ptr_abc->setInitializer(blockItems); I get error with following: Unsupported type in Type::getScalarTy Can anyone suggest what I suppose to do? It is definitely related to my type declaration and BlockAddress items, but I don't know w...
2019 Feb 22
1
Create the GlobalVariable which have extern in one header file
...ize mismatch? Here is my code: GlobalVariable *old = M.getGlobalVariable("DATA_TABLE"); old->setAlignment(16); old->setSection("data_section"); old->addAttribute(llvm::Attribute::OptimizeNone); old->setDSOLocal(false); GlobalVariable *gNew = new GlobalVariable( M, blockItems->getType(), false, GlobalValue::ExternalLinkage, blockItems, "DATA_TABLE"); gNew->setAlignment(16); gNew->setSection("data_section"); gNew->addAttribute(llvm::Attribute::OptimizeNone); On Feb 22 2019, at 12:02 am, Tim Northover <t.p.northover at gmail.com> wro...