Displaying 1 result from an estimated 1 matches for "valueasptr".
Did you mean:
value_str
2015 May 28
1
[LLVMdev] Passing ConstantDataArray to GetElementPtrInst
...: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, "callprintf");
Note that this is summarized, I already have the IRBuilder, etc initialized.
I've also tried this...