Displaying 1 result from an estimated 1 matches for "index_vector".
2015 May 28
1
[LLVMdev] Passing ConstantDataArray to GetElementPtrInst
...o figure out what I'm
supposed to pass to the GetElementPtrInst. For example, this snippet:
std::vector<llvm::Value*> args;
auto strValue =
llvm::ConstantDataArray::getString(llvm::getGlobalContext(),
llvm::StringRef("Hello world."));
std::vector<llvm::Value*> index_vector;
index_vector.push_back(Builder.getInt32(0));
index_vector.push_back(Builder.getInt32(0));
auto valueAsPtr = Builder.CreateGEP(strValue, index_vector, "tmp1");
args.push_back(valueAsPtr);
Builder.CreateCall(TheModule->getFunction("printf"), args, "cal...