Displaying 1 result from an estimated 1 matches for "const_ptr_14_indices".
Did you mean:
const_ptr_103_indices
2017 Apr 08
2
Getting a pointer to a i8 from a global variable that holds a constant string
...nstant* c = llvm::ConstantDataArray::getString(m_context, str);
var->setInitializer(c);
The part below is the one I have problems with:
llvm::ConstantInt* const_int32_12 = llvm::ConstantInt::get(m_context,
llvm::APInt(32, llvm::StringRef("0"), 10));
std::vector<llvm::Constant*> const_ptr_14_indices;
const_ptr_14_indices.push_back(const_int32_12);
const_ptr_14_indices.push_back(const_int32_12);
return llvm::ConstantExpr::getGetElementPtr(nullptr,c,
const_ptr_14_indices);
I realize that the GlobalVariable should not be declared every time I get
in that function but that's something I'l...