search for: mk_string

Displaying 1 result from an estimated 1 matches for "mk_string".

Did you mean: m_string
2010 Jun 01
2
[LLVMdev] How to create global string array? (user question)
...lude "llvm/Module.h" #include "llvm/DerivedTypes.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Analysis/Verifier.h" #include <stdio.h> #include <vector> using namespace llvm; using namespace std; Constant* mk_string(Module *M, LLVMContext &Context, const string &svalue) { ArrayType *Ty = ArrayType::get(Type::getInt8Ty(Context),svalue.size()+1); GlobalVariable *GV = new llvm::GlobalVariable( *M, Ty, true, GlobalValue::InternalLinkage, ConstantArray::get(Context,svalue),...