search for: makellvmmodule

Displaying 13 results from an estimated 13 matches for "makellvmmodule".

2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
...thExtras.h> #include <llvm/Pass.h> #include <llvm/PassManager.h> #include <llvm/ADT/SmallVector.h> #include <llvm/Analysis/Verifier.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Linker.h> #include <algorithm> using namespace llvm; Module* makeLLVMModule(); int main(int argc, char**argv) { Module* Mod = makeLLVMModule(); verifyModule(*Mod, PrintMessageAction); PassManager PM; PM.add(createPrintModulePass(&outs())); printf("===original==\n"); PM.run(*Mod); Module* ModL = new Module("xL.ll", getGlobalC...
2009 Oct 03
1
[LLVMdev] LLVM-Kaleidoscope tutorial
Good morning everyone, It seems the LLVM tutorial is not up to date anymore and doesn't compile as is... The function makeLLVMModule() function doesn't compile at all. Here is a fix: Module *makeLLVMModule() { // Caches the global context to share it with new Module() and IntegerType::get() calls LLVMContext &context = getGlobalContext(); // Module Construction Module *mod = new Module("tes...
2009 Jun 17
0
[LLVMdev] Segmentation fault - Kaleidoscope
...W, I'm also suddenly experiencing segfaults in code that used to work a few days ago (I'm using svn). This may be unrelated to the problem described below, but perhaps it's the same thing. In my case it seems that creating an ExecutionEngine has changed. I used to do Module* Mod = makeLLVMModule(); // basically create a gcd function verifyModule(*Mod, PrintMessageAction); ExecutionEngine *EE; EE = ExecutionEngine::create(Mod); but I now get 0x0 for EE. The compile command I'm using is g++ -O3 -I ~/llvm/include/ -L ~/llvm bug.cpp `llvm-config --cxxflags --ldflags --l...
2009 Jun 17
3
[LLVMdev] Segmentation fault - Kaleidoscope
Hello, Following the tutorial "Kaleidoscope: Adding JIT and Optimizer Support", I found a Segmentation fault when I try to execute it. I am new in the neighbourhood, so I don't know what is wrong. Could you help me with that? I am working with the last version of LLVM (2.5). The code in chapter 2 and 3 works good, but the code in the chapter 4 did not work. Below are the detail of
2010 Apr 28
1
[LLVMdev] LLVM Tutorial 1: Something got wrong?
...ow cann't be compiled throuth. the compiler complains: error: no matching function for call to ‘llvm::IntegerType::get(int)’ /usr/local/include/llvm/DerivedTypes.h:108: note: candidates are: static const llvm::IntegerType* llvm::IntegerType::get(llvm::LLVMContext&, unsigned int) Module* makeLLVMModule() { // Module Construction Module* mod = new Module("test", getGlobalContext()); Constant* c = mod->getOrInsertFunction("mul_add", /*ret type*/ IntegerType::get(32), /*args*/ IntegerType::get(32),...
2009 Jan 19
6
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
...RBuilder.h> #include <llvm/Support/Debug.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/ModuleProvider.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Support/raw_ostream.h> #include <stdio.h> using namespace llvm; Module *makeLLVMModule (); Function *foo; int main (int argc, char **argv) { Module *Mod = makeLLVMModule (); verifyModule (*Mod, PrintMessageAction); PassManager PM; PM.add (new PrintModulePass ()); PM.run (*Mod); ExecutionEngine *engine = ExecutionEngine ::create(Mod); // DebugFlag = true; // Curre...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...Assertion `I != ValueMap.end() && "Value not in slotcalculator!"' failed. Aborted ---------------------------------------------------------------------- And here is the source code of my example. ---------------------------------------------------------------------- Module* makeLLVMModule(LLVMContext& Context); Module* makeMainModule(LLVMContext& Context, Module &inMod); static tool_output_file *GetOutputStream(const char *FileName) { std::string error; tool_output_file *FDOut = new tool_output_file(FileName, error, raw_fd_ostream::F_Binary); if (!error.empty...
2009 Jun 17
10
[LLVMdev] Segmentation fault - Kaleidoscope
...s in code that used to > work > a few days ago (I'm using svn). This may be unrelated to the problem > described below, but perhaps it's the same thing. > > In my case it seems that creating an ExecutionEngine has changed. I > used > to do > > Module* Mod = makeLLVMModule(); // basically create a gcd > function > verifyModule(*Mod, PrintMessageAction); > > ExecutionEngine *EE; > EE = ExecutionEngine::create(Mod); > > but I now get 0x0 for EE. The compile command I'm using is > > g++ -O3 -I ~/llvm/include/ -L ~/llvm bug....
2009 Jun 17
0
[LLVMdev] Segmentation fault - Kaleidoscope
...; > a few days ago (I'm using svn). This may be unrelated to the problem > > described below, but perhaps it's the same thing. > > > > In my case it seems that creating an ExecutionEngine has changed. I > > used > > to do > > > > Module* Mod = makeLLVMModule(); // basically create a gcd > > function > > verifyModule(*Mod, PrintMessageAction); > > > > ExecutionEngine *EE; > > EE = ExecutionEngine::create(Mod); > > > > but I now get 0x0 for EE. The compile command I'm using is > > > &gt...
2009 Oct 04
4
[LLVMdev] LLVMdev Digest, Vol 64, Issue 5
...stemcall.org> > Subject: Re: [LLVMdev] LLVM-Kaleidoscope tutorial > > 2009/10/3 Remy Demarest <remy.demarest at gmail.com>: >> Good morning everyone, >> It seems the LLVM tutorial is not up to date anymore and doesn't compile as >> is... >> The function makeLLVMModule() function doesn't compile at all. Here is a > > The Kaleidoscope in the source tree is correct, but the web page is > not updated as often. Lots has changed since and you should use the > source on: > > llvm/examples/Kaleidoscope
2013 Nov 26
0
[LLVMdev] Help needed with a pass
...n.h"#include "llvm/Support/raw_ostream.h"#include "llvm/IR/Module.h"#include "llvm/PassManager.h"#include "llvm/Analysis/Verifier.h"#include "llvm/Assembly/PrintModulePass.h"#include "llvm/IR/IRBuilder.h" using namespace llvm; Module* makeLLVMModule() { Module* mod = new Module(getGlobalContext()); Function* strncpy_func = cast<Function>(mod->getOrInsertFunction(new StringRef("strncpy"), Type::getInt32Ty(getGlobalContext()), Type::getInt32Ty(getGlobalContext()), Type::getInt32Ty(getGlobalContext()), NULL)); Fu...
2009 Oct 03
1
[LLVMdev] code generation goes into an infinite loop
...ong LLVM datastructures somehow and the verifier is not catching it before the emitter falls off a cliff. Please comment. Daniel // modified from: // llvm/docs/tutorial/JITTutorial1.html // make an LLVM module printf("%s:%d make module\n", __FILE__, __LINE__); // Module* Mod = makeLLVMModule(); llvm::Module *mod = new llvm::Module("test"); // make a function object printf("%s:%d make function\n", __FILE__, __LINE__); // Constant* c = mod->getOrInsertFunction // ("mul_add", // /*ret type*/ IntegerType::get(32), // /*args*/ IntegerT...
2016 Feb 16
2
LLVM IR to C++
Hi, I want to convert LLVM bitcode files to cpp. I use these commands: 1. clang -c -emit-llvm -fopenmp=libiomp5 oh2.c -o oh2.bc2. llc -march=cpp oh2.bc -o oh2.cpp3. g++ -fno-rtti -O0 -g `$HOME/llvmbuild/bin/llvm-config --cxxflags` oh2.cpp `$HOME/llvmbuild/bin/llvm-config --ldflags --libs --system-libs` -o oh2c After the 3rd command, I get a lot of compilation errors. Is it possible that llc