search for: strexpr

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

Did you mean: str2expr
2017 Apr 08
2
Getting a pointer to a i8 from a global variable that holds a constant string
...t to a function). The string itself is a constant kept in a global variable. My end goal is to generate the IR for something like "puts("Hello World")"; I'm stuck on the parameter part of the call instruction. So far I have something like this: const std::string& str = strExpr->value(); llvm::ArrayType* type = llvm::ArrayType::get(llvm::IntegerType::get(m_context, 8), str.size()+1); llvm::GlobalVariable* var = new llvm::GlobalVariable(m_module, type, true, llvm::GlobalValue::PrivateLinkage, nullptr, ".str"); var->setAlignment(1);; llvm::Constant* c = llv...