search for: setbodi

Displaying 20 results from an estimated 25 matches for "setbodi".

Did you mean: setbody
2015 Jul 16
2
[LLVMdev] Adding integer field to all C++ classes in LLVM
Hi, I want to add an integer field to all C++ classes in LLVM. Where do I look at in the LLVM source to make the necessary changes? As of now, what I understand is that I need to make changes in Type.cpp (llvm/lib/IR/Type.cpp) where I insert an integer field in the ArrayRef passed to StructType::setBody? Thanks! -Mohit. -------------- next part -------------- An HTML attachment was scrubbed...
2015 Jan 30
2
[LLVMdev] More kinds of recursive types in llvm
The language I am working on connecting to an llvm back-end (Modula-3) allows a fairly extensive set of recursive declarations. It looks like I can translate all its high-level types using four llvm types that refer to another type: function, struct, pointer, and array. It looks like I can alter an llvm struct type in place after it has been created, using StructType::setBody. I don't see a
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
I'm implementing c style "sizeof()", and I did as http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt illuarstrated, and it works find, here's an example of my implementation: auto *p = builder.CreateGEP(structTy, llvm::ConstantPointerNull::get(pointerTy), constint1); auto *size =
2011 Jul 08
0
[LLVMdev] type-system-rewrite branch near landing
> 1. Clang - Jay, do you have a patch for this?  Can you create a branch of the clang repo or send an updated version of the patch to the list? I've created a clang type-system-rewrite branch and committed all my purely mechanical changes: de-constifying llvm::Types as necessary, and using the new llvm::StructType::createNamed/setBody to create the "implicit" structs used by
2011 Jul 12
2
[LLVMdev] r134829
On Jul 12, 2011, at 5:04 AM, Vitaly Lugovskiy wrote: > Hi Chris, > > What's a new way of building recursive types (with C bindings), once > RefineType had been removed? And what's an exact reason for getting > rid of the opaque types - I could not find a relevant discussion in a > mailing list. Hi Vitaly, I didn't add this API, because I'm not very familiar
2011 Jul 19
1
[LLVMdev] StructType::setName(...)
My apologies if this has already been discussed/explained (reference?). In browsing the new type system implementation, I was wondering if someone could give a simple example of why one would want to reset the name of a previous realized StructType instance (setBody(...) has been called). My curiosity is enhanced by the fact that reseting a name of a StructType instance may result in a symbol
2011 Nov 28
1
[LLVMdev] LLVM 3.0 release notes
On Nov 28, 2011, at 7:20 AM, Joe Abbey wrote: > Internal API changes mentioned the Type system changes twice... merging. It should now read: > > The biggest and most pervasive change is that the type system has been rewritten: PATypeHolder and OpaqueType are gone, and all APIs deal with Type* instead of const Type*. If you need to create recursive structures, then create a named
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:
2013 Feb 17
2
[LLVMdev] Emitting recursive types
Hi, I'm having a play with LLVM to implement a custom language (for my intellectual curiosity only). I'm wondering how, when using IRBuilder, one can can it to emit a recursive type definition? The code for TypeBuilder explicitly states that it doesn't handle recursive types... I'm after being able to emit, programmatically, stuff like the Named Types example in the Language
2013 Jul 29
1
[LLVMdev] PointerType without body, post-construction set type?
With StructType you can create an empty structure and then call setBody later. How can one do the same thing with a PointerType? I'm translating a recursive structure which includes pointers to itself. I end up creating multiple copies of logically equivalent pointer types. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally
2013 Jan 22
2
[LLVMdev] StructType opaque->sized
I'm building a StructType without a body using StructType *StructType::create(LLVMContext &Context, StringRef Name); and then later adding a body to with setBody(). It starts of isOpaque() == true, and isSized() == false, and after I add the body, isOpaque() == false, but isSized() is still false. If I create a StructType using StructType * StructType ::create(LLVMContext
2011 Oct 05
2
[LLVMdev] infinitely recursive named struct types
Hi, Looks like it is possible to create an infinitely recursive struct type, llvm-as accepts this: %s = type { i32, i8, %s } define %s @foo(%s* %a) { %y = load %s* %a ret %s %y } %s2 = type { i32, %s3} %s3 = type { i8, %s2} declare %s3 @foo2(); Similarly it is doable via the API: create a named struct, create elements where one refers directly to the newly created struct (instead of
2011 Nov 28
0
[LLVMdev] LLVM 3.0 release notes
Internal API changes mentioned the Type system changes twice... merging. It should now read: The biggest and most pervasive change is that the type system has been rewritten: PATypeHolder and OpaqueType are gone, and all APIs deal with Type* instead of const Type*. If you need to create recursive structures, then create a named structure, and use setBody() when all its elements are built. Type
2011 Jun 25
0
[LLVMdev] inefficiencies in ConstantUniqueMap ?
On 25 June 2011 13:00, Duncan Sands <baldrick at free.fr> wrote: >> 3. Clang/dragonegg need to adapt to the new API (help appreciated!) > > what needs to be done exactly? Background info: http://www.nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt As I understand it, PATypeHolder, OpaqueType and the Module's TypeSymbolTable are gone. Instead, StructTypes can optionally be
2011 Jun 25
3
[LLVMdev] inefficiencies in ConstantUniqueMap ?
Hi Chris, > 3. Clang/dragonegg need to adapt to the new API (help appreciated!) what needs to be done exactly? Ciao, Duncan.
2011 Nov 27
4
[LLVMdev] LLVM 3.0 release notes
The first draft of the LLVM 3.0 release notes now done, in llvm/docs/ReleaseNotes.html (the web page isn't autoupdating at the moment). Please take a look and make corrections or enhancements as you see fit. There are still a few things that I need from specific people (marked with XXX's): - BillW is writing a blog about exception handling. - The llvm.expect intrinsic isn't documented
2011 Jul 07
5
[LLVMdev] type-system-rewrite branch near landing
An update on the type-system-rewrite branch (http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/): It's now to the point where it passes all regression tests all of single source (and most of externals/multisource) when using an LLVM 2.9 version of clang to compile programs to a rbc file. I have what looks like one more subtle type mapping bug to track down, which will
2011 Oct 06
0
[LLVMdev] infinitely recursive named struct types
On Oct 5, 2011, at 4:58 AM, Török Edwin wrote: > Hi, > > Looks like it is possible to create an infinitely recursive struct type, llvm-as accepts this: > %s = type { i32, i8, %s } This should be illegal, and should probably be caught by the verifier. -Chris > > define %s @foo(%s* %a) { > %y = load %s* %a > ret %s %y > } > > %s2 = type { i32, %s3} >
2013 Jan 22
0
[LLVMdev] StructType opaque->sized
Hi Rick, On 22/01/13 09:04, Rick Mann wrote: > I'm building a StructType without a body using > > StructType *StructType::create(LLVMContext &Context, StringRef Name); > > and then later adding a body to with setBody(). It starts of isOpaque() == true, and isSized() == false, and after I add the body, isOpaque() == false, but isSized() is still false. this is the standard
2011 Jul 18
4
[LLVMdev] questions about the type system rewrite
Hi, Question 1: Will the new type system allow to incrementally build structs (instead of filling all the fields in one go, as in the example given in <http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt>? Question 2: Will the ocaml bindings to be updated to work with the new type system once the merging of the rewrite to the main branch is done? Thanks very much, N