Displaying 2 results from an estimated 2 matches for "getorcreatefunct".
2017 Oct 14
2
Bug in replaceUsesOfWith: does not keep addrspace consistent in GEP
...LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/FileSystem.h"
using namespace llvm;
using namespace std;
static const bool NON_VAR_ARG = false;
static AssertingVH<Function> getOrCreateFunction(Module &m, FunctionType *FTy,
std::string name) {
Function *F = m.getFunction(name);
if (F) return F;
return Function::Create(FTy, GlobalValue::ExternalLinkage, name, &m);
};
static const bool SHOW_ERROR = false;
int main() {...
2017 Apr 28
3
How to get the address of a global variable in LLVM?
On 28 April 2017 at 14:32, Jonathan Roelofs via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> You need a load instruction since your function takes an i32, not an
> i32*.... A global's value in llvm is its address, not the numeric data it
> contains.
I suspect he actually wants to make his function take an "i8*" and
bitcast his pointer to that type before calling it.