search for: newsty

Displaying 20 results from an estimated 23 matches for "newsty".

2005 Mar 08
2
[LLVMdev] Recursive Types using the llvm support library
...ype { %struct.linked_list*, %sbyte* } > > Use something like this: > > 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* }", tell VMCore that > // the struct and the opaque type are actually the same. > cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); > > // NewSTy is potentially in...
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
.... > > %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)); Elts.push_back(PointerType::get(Type::SByteTy)); StructType *NewSTy = StructType::get(Elts); // At this point, NewSTy = "{ opaque*, sbyte* }", tell VMCore that // the struct and the opaque type are actually the same. cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); // NewSTy is potentially invalidated, but StructTy (a...
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,
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
...te* } >> >> Use something like this: >> >> 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* }", tell VMCore that >> // the struct and the opaque type are actually the same. >> cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); >> >> //...
2005 Mar 15
2
[LLVMdev] Dynamic Creation of a simple program
...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* }", tell VMCore that // the struct and the opaque type are actually the same. cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); // NewSTy is potentially invalidated, but StructTy (a PATypeHolde...
2008 Sep 12
2
[LLVMdev] Order of fiels and structure usage
...oint? I'm hoping yes, but I suspect No, because the elments of Elts* are clearly Type* instead of being a field. In particular, if I use the same type twice to make two fields, the corresponding elements of Elts will be indistinguishable. Elts.push_back(Type::Int32Ty); StructType *NewSTy = StructType::get(Elts); Presumably at this point is is definitely possible to declare variables of type NewsTy and use field-selectors from NewSTy. But it's a little too late for my purposes. The types I'm dealing with are not recursive, but of course I'll have to perform the res...
2005 Mar 15
0
[LLVMdev] Dynamic Creation of a simple program
...e 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* }", tell VMCore that > // the struct and the opaque type are actually the same. > cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); > > // NewSTy is potentially invalidated,...
2008 Jun 13
1
[LLVMdev] code generation order revisited.
...//llvm.org/docs/ProgrammersManual.html#BuildRecType > > — Gordon Here it is: : // 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); Here NewSTy is a pointer to StructType. : // At this point, NewSTy = "{ opaque*, i32 }". Tell VMCore that : // the struct and the opaque type are actually the same. : cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); : // NewSTy is potent...
2005 Mar 09
4
[LLVMdev] Recursive Types using the llvm support library
...; Use something like this: >>> >>> 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* }", tell VMCore that >>> // the struct and the opaque type are actually the same. >>> cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); >>&...
2008 Oct 03
1
[LLVMdev] Question about recursive types
...ple 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 = "{ opaque*, i32 }". Tell VMCore that // the struct and the opaque type are actually the same. cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); // NewSTy is potentially invalidated, but StructTy (a PATypeHolder)...
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 Sep 12
0
[LLVMdev] Order of fiels and structure usage
...ut I suspect No, > because the elments of Elts* are clearly Type* instead of being a field. > In particular, if I use the same type twice to make two fields, the > corresponding elements of Elts will be indistinguishable. I'm not following; are you trying to access the first member of NewSTy here? You can't use a type that hasn't been created yet. You might be able to pull some tricks with incomplete types or casts, though. http://llvm.org/docs/LangRef.html#i_getelementptr and http://llvm.org/docs/GetElementPtr.html might be useful here. > Elts.push_back(Type::Int32Ty...
2005 Mar 16
1
[LLVMdev] Dynamic Creation of a simple program
...e 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* }", tell VMCore that > > // the struct and the opaque type are actually the same. > > cast<OpaqueType>(StructTy.get())->refineAbstractTypeTo(NewSTy); > > > > // NewS...
2008 Oct 03
0
[LLVMdev] Making Sense of ISel DAG Output
On Fri, October 3, 2008 9:10 am, David Greene wrote: > On Thursday 02 October 2008 19:32, Dan Gohman wrote: > >> Looking at your dump() output above, it looks like the pre-selection >> loads have multiple uses, so even though you've managed to match a >> larger pattern that incorporates them, they still need to exist to >> satisfy some other users. > > Yes,
2008 Oct 03
3
[LLVMdev] Making Sense of ISel DAG Output
On Thursday 02 October 2008 19:32, Dan Gohman wrote: > Looking at your dump() output above, it looks like the pre-selection > loads have multiple uses, so even though you've managed to match a > larger pattern that incorporates them, they still need to exist to > satisfy some other users. Yes, I looked at that too. It looks like these other uses end up being chains to
2008 Sep 13
3
[LLVMdev] Order of fiels and structure usage
...gt; because the elments of Elts* are clearly Type* instead of being a >> field. In particular, if I use the same type twice to make two fields, >> the corresponding elements of Elts will be indistinguishable. > > I'm not following; are you trying to access the first member of NewSTy > here? You can't use a type that hasn't been created yet. You might be > able to pull some tricks with incomplete types or casts, though. What I want is to be able to use the fields that have already been defined, even though the type isn't complete yet. The vector<const...
2005 Mar 09
0
[LLVMdev] Recursive Types using the llvm support library
On Wed, 9 Mar 2005, Vladimir Merzliakov wrote: > I create test program and assert failed in it: > > { \2 *, sbyte * } > Assertion failed: (!NewSTy->isAbstract()), function main, file > /usr/home/wanderer/work/LLVMTest/obj/../src/tools/tool/Test.cc, line 28. > > Testcase source attached. Thanks, that definitely is a bug. Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050307/024522.html BTW, what are yo...
2006 May 04
1
[LLVMdev] Documentation on LLVM type system
Hi, Is there any description of the type system of LLVM more detailed than ProgrammersManual.html ? I am a newbie to LLVM and I spent quite some time browsering the source code trying to truly understand the type resolution example in the ProgrammersManual.html (e.g. Why "NewSTy" is potentially invalidated, how StrutTy is updated,etc). So I think a documentation on the overall logical structure of this design maybe rather helpful to all newbies :) -- Regards, Nai
2005 Mar 21
0
[LLVMdev] Recursive Types using the llvm support library
On Wed, Mar 09, 2005 at 04:05:32PM +0300, Vladimir Merzliakov wrote: > >>Is assert(!NewSTy->isAbstract()) must pass after this line? > > > >In this case, yup. > > > I create test program and assert failed in it: > > { \2 *, sbyte * } How do I decode the \2 in this? I am creating types through this interface and I get quite a mess seen below. And this is...