similar to: [LLVMdev] StructType opaque->sized

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] StructType opaque->sized"

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
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:
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
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...
2011 Feb 27
0
[LLVMdev] LLVM IR Type System Rewrite
Hi Chris I have questions about new IR. > Named structs. > Unnamed structs (named structs with no names) > Anonymous structs (things like complex, which cannot be cyclic) > >Given this, the rules above would be that "only non-anonymous structs can have >cycles" for example. Arrays, pointers and other non-namable types can be >considered to be anonymous as well.
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function
2012 Sep 19
0
[LLVMdev] newbie question on getelementptr
Hi Óscar, Thank you for your prompt reply. Unfortunately, I still need more guidance as using the Demo page to generate C++ code didn't result in a global variable being used. Basically, I'm following your advice to use a LoadInst: Value *v = new LoadInst(result, "", theBasicBlock); Function *myfn = cast<Function>(v); I was not sure how I could get a BasicBlock for the
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
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
2004 Dec 03
1
[Fwd: [LLVMdev] GetElementPtr for packed types and VS build]
This needs to be applied as well. Thanks, Reid. -----Forwarded Message----- > From: Morten Ofstad <morten at hue.no> > To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu> > Subject: [LLVMdev] GetElementPtr for packed types and VS build > Date: Wed, 01 Dec 2004 15:10:49 +0100 > > As I was working with packed types it became apparent that I sometimes >
2009 May 08
3
[LLVMdev] Suggestion: Support union types in IR
Chris Lattner wrote: > On Dec 30, 2008, at 12:41 PM, Talin wrote: > >> I've been thinking about how to represent unions or "disjoint types" >> in LLVM IR. At the moment, the only way I know to achieve this right >> now is to create a struct that is as large as the largest type in >> the union and then bitcast it to access the fields contained
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
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
2009 May 08
0
[LLVMdev] Suggestion: Support union types in IR
Talin wrote: > Chris Lattner wrote: >> On Dec 30, 2008, at 12:41 PM, Talin wrote: >> >>> I've been thinking about how to represent unions or "disjoint types" >>> in LLVM IR. At the moment, the only way I know to achieve this right >>> now is to create a struct that is as large as the largest type in >>> the union and then
2006 Dec 08
0
[LLVMdev] Proposed: first class packed structures
On Dec 6, 2006, at 10:44 AM, Andrew Lenharth wrote: > Currently, Structure layout is left to targets, which implement them > according to the ABI of that platform. While this is fine for most > structures, it makes packed structures very ugly. All fields in a > packed type must be converted to byte arrays with casts to access > fields, which bloats accesses and obsfucates the
2006 Dec 06
4
[LLVMdev] Proposed: first class packed structures
Currently, Structure layout is left to targets, which implement them according to the ABI of that platform. While this is fine for most structures, it makes packed structures very ugly. All fields in a packed type must be converted to byte arrays with casts to access fields, which bloats accesses and obsfucates the types. First class support for packed types would clean up the generated code
2010 Oct 26
2
[LLVMdev] StructType member offset
Hi, how can i correctly calculate the size of a member of a struct (including alignment etc)? This doesn't work : const StructType *STy = cast<StructType>(Ty); for (StructType::element_iterator I = STy->element_begin(), E = STy->element_end(); I != E; ++I) { usigned size =I->get()->getScalarSizeInBits(); //often