Displaying 20 results from an estimated 500 matches similar to: "sizeof implementation: how to get size as a constantInt?"
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
On Mon, 7 Mar 2005, John Carrino wrote:
> As far as I can tell, when you construct a type using the support
> library StructType::get, you have to pass in a list of types. How can
> you make a Recursive type by passing in a pointer to the type you are
> constucting.
>
> An example where something really simple like the line below was output
> would be perfect.
>
>
2005 Mar 08
2
[LLVMdev] Recursive Types using the llvm support library
>> An example where something really simple like the line below was output
>> would be perfect.
>>
>> %struct.linked_list = type { %struct.linked_list*, %sbyte* }
>
> Use something like this:
>
> PATypeHolder StructTy = OpaqueType::get();
> std::vector<const Type*> Elts;
> Elts.push_back(PointerType::get(StructTy));
>
2004 Oct 06
1
[LLVMdev] generating function declarations in c frontend
I'm trying to generate the declarations for function intrinsics, and I
must be misunderstanding how to create new functions - I saw that a
function with no basic blocks is treated as a declaration, so I tried
to just create one and add it to the globals list:
llvm_type *structTy, *ptrToStructTy;
structTy = llvm_type_create_struct(0, 0);
structTy =
2005 Mar 15
2
[LLVMdev] Dynamic Creation of a simple program
Thanks for the information
I am trying to use one of your examples for recursive data structures:
=========================
PATypeHolder StructTy = OpaqueType::get();
std::vector<const Type*> Elts;
Elts.push_back(PointerType::get(StructTy));
Elts.push_back(PointerType::get(Type::SByteTy));
StructType *NewSTy = StructType::get(Elts);
// At this point, NewSTy = "{ opaque*, sbyte*
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
On Tue, 8 Mar 2005, Vladimir Merzliakov wrote:
>>> An example where something really simple like the line below was output
>>> would be perfect.
>>>
>>> %struct.linked_list = type { %struct.linked_list*, %sbyte* }
>>
>> Use something like this:
>>
>> PATypeHolder StructTy = OpaqueType::get();
>> std::vector<const
2005 Mar 15
0
[LLVMdev] Dynamic Creation of a simple program
On Tue, 15 Mar 2005, xavier wrote:
> Thanks for the information
> I am trying to use one of your examples for recursive data structures:
>
> =========================
> PATypeHolder StructTy = OpaqueType::get();
> std::vector<const Type*> Elts;
> Elts.push_back(PointerType::get(StructTy));
> Elts.push_back(PointerType::get(Type::SByteTy));
> StructType *NewSTy =
2008 Sep 12
2
[LLVMdev] Order of fiels and structure usage
I'd like to be able to make use of a structure type and its fields before
it is completely defined. To be specific, let me ask detailed questions
at various stages in the construction of a recursive type. I copy from
http://llvm.org/docs/ProgrammersManual.html#TypeResolve
// Create the initial outer struct
PATypeHolder StructTy = OpaqueType::get();
Is it possible to declare
2012 Nov 09
1
[LLVMdev] Do I need to calculate padding by myself to construct a StructType ?
I am using LLVM C++ API to generate IR for some structure data.
For example:
struct mystruct {int a:1; int b:2; unsigned long c} = {{1, 2, 3}};
I read the document and tried the demo cgi, it seems the API requires user
to handle padding and value combination for the initializer by themselves.
Is there any way to create the struct more simply like this:
2008 Jun 13
1
[LLVMdev] code generation order revisited.
On Thu, 12 Jun 2008 16:05:19 -0400, Gordon Henriksen wrote:
>
> Partially opaque types can be refined. This section of the programmer's
> manual is applicable:
>
> http://llvm.org/docs/ProgrammersManual.html#BuildRecType
>
> — Gordon
Here it is:
: // Create the initial outer struct
: PATypeHolder StructTy = OpaqueType::get();
: std::vector<const Type*> Elts;
:
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 =
2008 Sep 12
0
[LLVMdev] Order of fiels and structure usage
On Fri, Sep 12, 2008 at 9:35 AM, Hendrik Boom <hendrik at topoi.pooq.com> wrote:
> I'd like to be able to make use of a structure type and its fields before
> it is completely defined. To be specific, let me ask detailed questions
> at various stages in the construction of a recursive type. I copy from
>
> http://llvm.org/docs/ProgrammersManual.html#TypeResolve
>
>
2005 Mar 08
3
[LLVMdev] Recursive Types using the llvm support library
As far as I can tell, when you construct a type using the support
library StructType::get, you have to pass in a list of types. How can
you make a Recursive type by passing in a pointer to the type you are
constucting.
An example where something really simple like the line below was output
would be perfect.
%struct.linked_list = type { %struct.linked_list*, %sbyte* }
Thanks for any help,
2012 May 07
4
[LLVMdev] Discussion of eliminating the void type
Hello all,
I am willing to do "eliminating the void type" project. Is there anyone
working on it?
=== Overview ===
The general concept is to replaced void with {}. And 'ret void' is a
synonym of 'ret {} {}.'
=== Further Implementation Details ===
1. Deleting VoidTyID
2. Deleting LLVMVoidTypeKind (one-to-one relation between VoidTyID and
LLVMVoidTypeKind)
3. Use
2012 May 07
0
[LLVMdev] Discussion of eliminating the void type
Hi Mitnick,
> === Overview ===
>
> The general concept is to replaced void with {}. And 'ret void' is a synonym of
> 'ret {} {}.'
in a sense the concept is just to delete void and not to replace it with
anything in particular. Of course front-ends (clang, dragonegg) need to produce
something instead of void, and {} is an example of what they might produce, but
they
2005 Mar 16
1
[LLVMdev] Dynamic Creation of a simple program
Hi,
Given these C instructions:
==============================
struct stru { struct stru *Next; };
struct list *NewStru = malloc ( sizeof ( struct stru ) );
struct list *tmp.3;
...
tmp.3 = NewStru->Next;
==============================
LLVM generates something like this:
%tmp.0 = malloc %struct.stru ; <%struct.stru*>
%tmp.3 = getelementptr %struct.stru* %tmp.0, int 0, uint 1 ;
2008 Jun 12
0
[LLVMdev] code generation order revisited.
On Jun 12, 2008, at 13:25, Hendrik Boom wrote:
> So it appears that types are processed for identity the moment they
> are made during parse tree construction?
Yes.
> This means that a type has to be completely known on creation.
Yes.
> Presumably there's some mechanism tor a type that isn't completely
> known yet -- or is thet avoided by having a type
2008 Jun 12
2
[LLVMdev] code generation order revisited.
>>
>> I think I may have found an exception to this -- the API seems to
>> require me to have all the fields for a struct ready before I
>> construct the struct. I don't have the ability to make a struct
>> type, use it to declare some variables, and still contribute fields
>> to it during the rest of the compilation.
>>
>> Is there a
2008 Jun 09
7
[LLVMdev] regression? Or did I do something wrong again?
I don't know if the toy program in chapter 4 of the tutorial
implementing Kaleidoscope in llvm with C++ is part of your
regression suite, but with the version of llvm I installed
last weekend, it does not compile:
hendrik at lovesong:~/dv/llvm/tut$ g++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy
toy.cpp: In member function ‘virtual llvm::Value*
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
I agree that the ArrayRef is likely the issue. I've debugged a crash caused
by a temporary ArrayRef like that a couple times.
Either do what David suggested or use a normal array:
Metadata *mdArray[] = {ConstantInt::get(Int64Ty, 0), newMD};
~Craig
On Thu, Apr 30, 2020 at 9:56 AM David Blaikie via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
>
> On Thu, Apr 30, 2020 at
2020 Apr 30
2
Discrepancy between Debug and Release+Asserts versions of Clang/LLVM
Hello,
I am editing the LowerTypeTests pass in LLVM, and part of my additions
include the following 3 lines of code:
// newTypeName is a std::string
MDString* newMD = MDString::get(M.getContext(), newTypeName);
ArrayRef<Metadata*> mdArray {ConstantInt::get(Int64Ty, 0), newMD};
auto* node = MDTuple::get(M.getContext(), mdArray);
Thus far, I have been developing on a version of Clang with