Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Alloca with LLVMContext"
2009 Jul 15
0
[LLVMdev] Alloca with LLVMContext
On Jul 15, 2009, at 8:14 AM, John Criswell wrote:
> Dear All,
>
> Is there a reason why the AllocaInst constructor takes an LLVMContext
> argument? Can't it just determine the context from either the basic
> block or instruction pointer argument?
BasicBlocks and Instructions don't necessarily have contexts, if
they're not attached to a module. You can also
2009 Jul 15
2
[LLVMdev] Alloca with LLVMContext
On Wed, Jul 15, 2009 at 8:52 AM, Owen Anderson<resistor at mac.com> wrote:
>
> On Jul 15, 2009, at 8:14 AM, John Criswell wrote:
>
> Dear All,
>
> Is there a reason why the AllocaInst constructor takes an LLVMContext
> argument? Can't it just determine the context from either the basic
> block or instruction pointer argument?
>
> BasicBlocks and
2013 Jul 31
1
[LLVMdev] Instruction insertion By Module Pass
Thank you for your help
I tried
Instruction* p=&( Bb->front());
Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext());
AllocaInst* newInst = new AllocaInst(Int32Type,"flag", p);
that works well
but I need to store the value of the variable too.
What's the method that could be used to store specific value??
On 30 July 2013 16:01, John Criswell
2013 Jul 25
2
[LLVMdev] Error for AllocaInst and Instruction
Hi,
For the following code
const Type * Int32Type =
IntegerType::getInt32Ty(getGlobalContext());
AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb);
Bb->getInstList().push_back(newInst);
It gives me the error
" error: no matching constructor for initialization of 'llvm::AllocaInst'
AllocaInst* newInst = new
2013 Jul 30
0
[LLVMdev] Instruction insertion By Module Pass
On 7/30/13 7:44 AM, Rasha Omar wrote:
> Hi,
> I need to insert new instruction into every basic block like x=1
> or while loop
> I tried this code, but it doesn't work
>
> Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext());
> AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb);
> Bb->getInstList().push_back(newInst);
The problem is
2013 Jul 30
2
[LLVMdev] Instruction insertion By Module Pass
Hi,
I need to insert new instruction into every basic block like x=1
or while loop
I tried this code, but it doesn't work
Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext());
AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb);
Bb->getInstList().push_back(newInst);
the error:
void llvm::SymbolTableListTraits<llvm::Instruction,
2012 May 27
0
[LLVMdev] Help with Values sign
I show you the trace of calls to llvm that my compiler makes to generate the
code above. bloques.back().last is of type Value* and bloques.back().bl is
BasicBlock* (the current Block)
bloques.back().last =
dyn_cast<Value>(ConstantInt::get(Type::getInt32Ty(getGlobalContext()), $1,
true)); // $1 is an int
AllocaInst *alloc =
new AllocaInst(
2017 Feb 21
3
What is the proper usage of LLVMContext?
Hi, I'm Ryo Ota. I have two questions about `llvm::LLVMContext`.
Q1) What is the difference between the following (A)`my_context` and
(B)`global_context`?
Do I have to create a LLVMContext by myself? Or use `getGlobalContext()`?
Could you tell me what situation needs a LLVMContext which is created by
myself such as (A)?
(A)
{
llvm::LLVMContext my_context;
// codes using only my_context (get
2009 Jul 01
0
[LLVMdev] MAJOR API CHANGE: LLVMContext
To ease this transition, I have added a getGlobalContext() API. If
you're only ever planning to use LLVM on a single thread, it will be
completely safe to simply pass this value to every API that takes an
LLVMContext.
--Owen
On Jun 30, 2009, at 3:38 PM, Owen Anderson wrote:
> Notice of a major upcoming API change: The static methods for
> constructing types and constants will
2009 Jul 15
1
[LLVMdev] LLVMContext: Suggestions for API Changes
Owen Anderson wrote:
>
> On Jul 15, 2009, at 9:53 AM, John Criswell wrote:
>
>> Owen Anderson wrote:
>>> On Jul 15, 2009, at 7:44 AM, John Criswell wrote:
>>>
>>>> 1) If technically possible, add the new API first, get it working,
>>>> email
>>>> llvmdev describing the old and new APIs, provide some lead time for
2009 Jun 30
6
[LLVMdev] MAJOR API CHANGE: LLVMContext
Notice of a major upcoming API change: The static methods for
constructing types and constants will be going away in the future.
Instead, the global uniquing tables that lurk behind these APIs will
be privatized within LLVMContext instances.
What this means for you: Your client application will need to create
an LLVMContext in main(), and pass it into a few APIs (the constructor
for
2012 Jan 23
1
[LLVMdev] Code crashing in CreateGlobalStringPtr, passes when I add code for main routine + entry
Hi All,
The following crashes in CreateGlobalStringPtr:
#include "llvm/Support/DataTypes.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Constants.h"
#include "llvm/Function.h"
#include "llvm/BasicBlock.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include
2012 Sep 05
2
[LLVMdev] llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool) deprecated?
Hi all;
I have been trying to use the llvm::ConstantArray::get(llvm::LLVMContext&,
llvm::StringRef, bool) function but seems it has been deprecated.
ProfileDependence.cpp:68:73: error: no matching function for call to
‘llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool)’
ProfileDependence.cpp:68:73: note: candidate is:
2015 Mar 10
4
[LLVMdev] noob IR builder question
I am trying to get a handle on IR builder, at least some basics. I ran through a tutorial here: Create a working compiler with the LLVM framework, Part 1 <http://www.ibm.com/developerworks/library/os-createcompilerllvm1/>, and it worked well enough. I have some simple code that creates a hello world IR. I am trying to now bring in some concepts from the Kaleidoscope tutorial, namely
2012 May 27
2
[LLVMdev] Help with Values sign
Hi everyone, I'm having some problems when loading values. Here's a simple
example of the IR that my compiler generates to show the problem:
define i32 @main() {
entry:
%a = alloca i32 ; <i32*> [#uses=2]
store i32 1, i32* %a
%r = load i32* %a ; <i32> [#uses=1]
br label %Return
Return:
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
Hi Justin,
my class is a visitor pattern and I use accept method to go recursive in
suboject in my AST.
In locals I store AllocaInst pointer.
void *visit(var1_init_decl_c *symbol) {
llvm::Type *lType;
varNames.clear();
varType = "";
symbol->var1_list->accept(*this); /* get a vector contains variable names */
symbol->spec_init->accept(*this); /* Store in
2009 Nov 05
3
[LLVMdev] create dummy function
Thank you very much for you help, Renato!
I read through paper you referred and also this document -
http://llvm.org/docs/tutorial/JITTutorial1.html
Following these instructions to create successful function I run into
some problems:
1) llvm::getGlobalContext() does not exists anymore? "llvm/LLVMContext.h" too?
2) creating instance of IRBuilder don't require template (from
tutorial
2010 Jan 04
4
[LLVMdev] Getting Kaleidoscope to compile
Hi all,
I've started work on a new programming language for which I am
considering using LLVM as the backend, and trying to experiment with
it using the Kaleidoscope demo compiler.
Taking the full source listing from
http://llvm.org/docs/tutorial/LangImpl3.html#code and trying to
compile it with the provided instructions gives me the following
errors:
a at a-desktop:~$ g++ -g -O3 toy.cpp
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
On Fri, Jan 11, 2013 at 8:20 AM, Manuele Conti
<manuele.conti at sirius-es.it>wrote:
> Hi Justin,
> my class is a visitor pattern and I use accept method to go recursive in
> suboject in my AST.
> In locals I store AllocaInst pointer.
>
>
> void *visit(var1_init_decl_c *symbol) {
> llvm::Type *lType;
>
> varNames.clear();
> varType = "";
2010 Jan 04
0
[LLVMdev] Getting Kaleidoscope to compile
Probably you missed to install llvm-dev package with headers for llvm.
2010/1/4 Russell Wallace <russell.wallace at gmail.com>
> Hi all,
>
> I've started work on a new programming language for which I am
> considering using LLVM as the backend, and trying to experiment with
> it using the Kaleidoscope demo compiler.
>
> Taking the full source listing from
>