Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] A beginner question"
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
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
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)),
>
2010 Jan 28
1
[LLVMdev] about pointer type
Dear all,
In the early llvm version, we could use PointerType::get(Type::Int32Ty)) to
get the pointer type. But in the latest llvm (version 2.6), it doesn't work.
Compiler says "‘Int32Ty’ is not a member of ‘llvm::Type’".
I've looked the doxygen document, however, I can't find an answer, would you
please help me? Thanks!
-Wink
--
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
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(
>>
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 =
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,
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
Hi all,
Please review this patch. It's fixing PR3232 comment #8. Function bar
from 2008-03-24-BitFiled-And-Alloca.c compiles to:
%struct.Key = type { { i32, i32 } }
...
define i32 @bar(i64 %key_token2) nounwind {
entry:
%key_token2_addr = alloca i64 ; <i64*> [#uses=2]
%retval = alloca i32 ; <i32*> [#uses=2]
%iospec =
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
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
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
Ah! I get it now. Thanks a lot !
I changed it to BitCastInst(AI,VoidPtrTy,"",j);
And now I am getting the following error :(. I have been stuck with this error before also. I know I am missing out something silly. What is the cause of this error and Please let me know how to fix it.
/home/bhavani/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1130: llvm::SDOperand
2008 Oct 03
1
[LLVMdev] Question about recursive types
Dear all,
I'm trying to run the example of recursive type construction examples
in LLVM Programmer's Manual, here is the code:
// Create the initial outer struct
PATypeHolder StructTy = OpaqueType::get();
std::vector<const Type*> Elts;
Elts.push_back(PointerType::get(StructTy));
Elts.push_back(Type::Int32Ty);
StructType *NewSTy = StructType::get(Elts);
// At this point, NewSTy =
2007 Dec 17
3
[LLVMdev] PointerType API Change
Christopher,
> The API for getting PointerType objects has just changed to make
> Embedded C address space information explicit. The old semantics of
> PointerType::get() now apply to PointerType::getUnqual(), which
> returns a pointer in the generic address space. PointerType::get() now
> requires both a type and an address space.
What is the reason of such change?
--
With best
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
Thanks Nick! ok. I ran through the verifier and this is the issue:
verifying... Instruction does not dominate all uses!
%tmp3 = add i32 %b, %a ; <i32> [#uses=2]
store i32 %tmp3, i32* %0, align 4
Broken module found, compilation aborted!
add is existing instruction in function. store is the instruction I have added to the function. How do I fix this now :(?
Thanks,
Bhavani
--- On Mon,
2007 Dec 17
2
[LLVMdev] PointerType API Change
Would it be possible to keep get() unchanged, with a default behaviour, plus
a warning? Otherwise everybody (assuming everybody gets type void*) will
have to update their LLVM passes, and either maintain two versions of the
passes or require their clients to use a certain LLVM version. Then passes
could be "address-space-safe" or not. If the default parameter value for
get() could
2007 Dec 17
3
[LLVMdev] PointerType API Change
The API for getting PointerType objects has just changed to make
Embedded C address space information explicit. The old semantics of
PointerType::get() now apply to PointerType::getUnqual(), which
returns a pointer in the generic address space. PointerType::get()
now requires both a type and an address space.
The clang, llvm-gcc-4.0, and llvm-gcc-4.2, and internal llvm projects
have all