Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] about pointer type"
2009 Jul 04
2
[LLVMdev] A beginner question
I feel a bit bad for always asking beginner questions here but I am having some difficulties with a runtime error with which I could use some help diagnosing.
1) I am getting the assertion failure
main: Type.cpp:1309: static llvm::PointerType* llvm::PointerType::get(const llvm::Type*, unsigned int): Assertion `ValueType && "Can't get a pointer to <null> type!"'
2009 May 21
3
[LLVMdev] Passing a pointer to a function
I recently began hacking around with my first LLVM pass. The big
picture is that I would like to insert function calls for each
instruction type, and pass some parameters based on the instruction
type. Then I will link the output to some C file that implements those
functions.
Things were going well until I started trying to make function calls
with a pointer as a parameter. For example, I would
2009 Sep 23
2
[LLVMdev] DebugFactory
On Sep 22, 2009, at 4:49 PM, Talin wrote:
>
> // Calculate the size of the specified LLVM type.
> Constant * DebugInfoBuilder::getSize(const Type * type) {
> Constant * one = ConstantInt::get(Type::Int32Ty, 1);
> return ConstantExpr::getPtrToInt(
> ConstantExpr::getGetElementPtr(
> ConstantPointerNull::get(PointerType::getUnqual(type)),
>
2014 Jan 08
3
[LLVMdev] reference to non-static member function must be called
Hi,everyone.
I'm writing a pass in which a CallInst to an external function will be
inserted. The function is declared like this:
void func(int a, unsigned chat *p);
and in the Pass(a Function Pass ,and using the InstVistor template ), I
wrote like this:
void visitStoreInst(StoreInst &SI)
{
//Get the refference of the types
Module *M =
2009 Jul 04
0
[LLVMdev] A beginner question
Carter Cheng wrote:
> I feel a bit bad for always asking beginner questions here but I am having some difficulties with a runtime error with which I could use some help diagnosing.
>
> 1) I am getting the assertion failure
>
> main: Type.cpp:1309: static llvm::PointerType* llvm::PointerType::get(const llvm::Type*, unsigned int): Assertion `ValueType && "Can't
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
2014 Jan 09
2
[LLVMdev] reference to non-static member function must be called
I'm using LLVM 3.3 Release. From the Class Reference Page. CallInst has a
member function :
static CallInst * Create (Value *Func, ArrayRef< Value * > Args, const
Twine &NameStr="", Instruction *InsertBefore=0)
This is what I want to use! the default name is "" and I also use that .
Thanks!
-----
Kind Regards!
-JinHuang
--
View this message in context:
2009 Sep 22
0
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>wrote:
> On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>
> wrote:
> > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote:
> >> So, one feature of the late, lamented DebugInfoBuilder that I am missing
> >> quite badly, and which is not
2009 Jul 04
1
[LLVMdev] A beginner question
The line comes up on a back trace using gdb. I think it's the right line (I have tried it on two separate machines one using Fedora 11 and g++ 4.4.x and the other Ubunto and g++ 4.3.3) and the situation is exceptionally odd since it only occurs when compiling my Runtime.cpp and doesnt happen when compiling other files. This is with LLVM 2.5.
I did look at the Type.cpp code and it should be
2008 Nov 17
2
[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
ok.. So I am trying out what you have suggested. I have written the below code which basically tries to write the constant 10 to a file. myprint is a function pointer to a function which takes char * parameter and writes it to file.
Value *Ten = ConstantInt::get(Type::Int32Ty, 10);
const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
AllocaInst *AI = new AllocaInst(Type::Int32Ty);
Value
2009 Sep 23
0
[LLVMdev] DebugFactory
On Wed, Sep 23, 2009 at 1:51 PM, Dan Gohman <gohman at apple.com> wrote:
>
> On Sep 22, 2009, at 4:49 PM, Talin wrote:
>
>>
>> // Calculate the size of the specified LLVM type.
>> Constant * DebugInfoBuilder::getSize(const Type * type) {
>> Constant * one = ConstantInt::get(Type::Int32Ty, 1);
>> return ConstantExpr::getPtrToInt(
>>
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,
2009 Sep 23
2
[LLVMdev] DebugFactory
On Wed, Sep 23, 2009 at 2:27 PM, Talin <viridia at gmail.com> wrote:
> On Wed, Sep 23, 2009 at 1:51 PM, Dan Gohman <gohman at apple.com> wrote:
>>
>> On Sep 22, 2009, at 4:49 PM, Talin wrote:
>>>
>>> // Calculate the size of the specified LLVM type.
>>> Constant * DebugInfoBuilder::getSize(const Type * type) {
>>> Constant * one =
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 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
2009 Sep 22
3
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com> wrote:
> On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote:
>> So, one feature of the late, lamented DebugInfoBuilder that I am missing
>> quite badly, and which is not available in the current DIFactory, is the
>> ability to specify structure offsets abstractly. The
2009 Sep 23
1
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 4:49 PM, Talin <viridia at gmail.com> wrote:
>
>
> On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>
> wrote:
>>
>> On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>
>> wrote:
>> > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote:
>>
2009 Mar 08
2
[LLVMdev] Creating Pointer Constants
Hello,
I am writing a JIT compiler for a subset of the Matlab language and as a
part of my implementation, I would like to be able to pass a constant
pointer to a native function I'm calling.
Right now, this is what I do:
llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty,
(int64)thePointer);
llvm::Value* constPtr = llvm::ConstantExpr::getIntToPtr(constInt,
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
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
Hello everybody,
my problem is, that I want to get an array of pointers to all local variables
in a function. This array will be used for transfering these Variables to
another execution engine.
I've code which generates this array, and a pointer to the target field of the
array.
name = variables.fname + "_pointerArray";
Instruction* pointerArray = new