search for: refineabstracttypeto

Displaying 20 results from an estimated 38 matches for "refineabstracttypeto".

Did you mean: refineabstracttype
2018 Aug 25
3
PATypeHolder, refineAbstractTypeTo(), addTypeName not found
...ompiler/Resolver.cpp, But some class/function of it is not present in my source code due to replacement of this function in newer llvm verion. Can someone please suggest me the alternative approach of these function in latest llvm version. Here are those classes and functions : 1) PATypeHolder 2) refineAbstractTypeTo() 3) addTypeName() 4) getLayoutType() 5) getInterfaceIndex() 6) OpaqueType::get() Many thanks in advance. With Regards, Ratnesh Tiwari -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180825/4caab194/attachm...
2008 May 18
1
[LLVMdev] Duplicate wrapper function in LLVM-C.
Hi (Gordon). There appears to be two wrapper functions for DerivedType::refineAbstractTypeTo() in llvm-c (Core.h, Core.cpp): void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType){ DerivedType *Ty = unwrap<DerivedType>(AbstractType); Ty->refineAbstractTypeTo(unwrap(ConcreteType)); } void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy)...
2010 Nov 17
1
[LLVMdev] Type unification algorithm
Hi All, I wanted to understand the type unification algorithm (the implementations of 'refineAbstractTypeTo') used in LLVM. In the source code, there are a lot of code relevant to 'refineAbstractTypeTo', and I didn't find a big picture about how it works. Does the code implement any standard type unification algorithm that I can refer to? What is a good start point to understand this algo...
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
...t(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 PATypeHolder) is // kept up-to-date. NewSTy = StructTy.get(); -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
2010 Jun 15
2
[LLVMdev] Adding fields in a already built type? (2)
...re is a section in the programmer's manual on this: > http://llvm.org/docs/ProgrammersManual.html#TypeResolve > > -Chris So I succeeded in using a "PATypeHolder" for the "opaque" type, define a Type* with PointerType::getUnqual, prepare a field, then use " refineAbstractTypeTo " to built the real type with this added field. The thing is that I would need to do that repeatedly, that is progressively adding fields, generates code that access those ready fields, and "refine" the type step by step. Is that even possible? Thanks Stéphane Letz
2005 Mar 08
2
[LLVMdev] Recursive Types using the llvm support library
....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 PATypeHolder) is > // kept up-to-date. > NewSTy = StructTy.get(); > Is assert(!NewSTy->isAbstract()) must pass after this line? Vladimir
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 15
2
[LLVMdev] Dynamic Creation of a simple program
...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 PATypeHolder) is // kept up-to-date. NewSTy = StructTy.get(); ========================= It gives this error in the last line: invalid conversion from `llvm::Type*' to `llvm::StructType*' How can I create such a recu...
2008 Nov 15
0
[LLVMdev] RefineAbstractType
...ome code that illustrates what I think is the problem. Compile with g++ -D__STDC_LIMIT_MACROS -I<path to LLVM headers> -L<path to LLVM libraries> -lLLVMCore -lLLVMSupport -lLLVMSystem -ldl (I built with LLVM 2.4) Output: i32 (\1) opaque (i32) This looks totally wrong. Am I using refineAbstractTypeTo incorrectly? I think what's happening is the internal type confusion exhibited in the output above is propagating through our compiler and eventually causes bad stuff to happen. When I step through in the debugger I see weird unrelated types like the opaque (i32) above....
2010 Jun 15
0
[LLVMdev] Adding fields in a already built type? (2)
...rammer's manual on this: >> http://llvm.org/docs/ProgrammersManual.html#TypeResolve >> >> -Chris > > > So I succeeded in using a "PATypeHolder" for the "opaque" type, define a Type* with PointerType::getUnqual, prepare a field, then use " refineAbstractTypeTo " to built the real type with this added field. > > The thing is that I would need to do that repeatedly, that is progressively adding fields, generates code that access those ready fields, and "refine" the type step by step. > > Is that even possible? It would work, b...
2005 Mar 08
0
[LLVMdev] Recursive Types using the llvm support library
...pe::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 PATypeHolder) is >> // kept up-to-date. >> NewSTy = StructTy.get(); >> > Is assert(!NewSTy->isAbstract()) must pass after this line? In this case, yup. -Chris -- http://nondot.org/s...
2008 Jan 14
1
[LLVMdev] Opaque type
Hello, I'm trying to translate part of Java code in LLVM code. I have some problems with the "opaque type", I think because I did not understand how to use. So, the java code is: int[] ai; .... ai = new int[1]; I am using LLVM API in this way: //I create a pointer of Opaque type, because I don't know yet the array size! OpaqueType* ot = OpaqueType::get(); AllocaInst*
2005 Mar 15
0
[LLVMdev] Dynamic Creation of a simple program
...> 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 PATypeHolder) is > // kept up-to-date. > NewSTy = StructTy.get(); > ========================= > > It gives this error in the last line: > > invalid conversion from `llvm::Type*' to `llvm::Struc...
2009 Jun 17
1
[LLVMdev] CMake does not work with LLVM anymore?
...ce to `llvm::sys::RWMutex::reader_release()' Type.cpp:(.text+0x3a7f): undefined reference to `llvm::sys::RWMutex::writer_acquire()' Type.cpp:(.text+0x3ab1): undefined reference to `llvm::sys::RWMutex::writer_release()' ../../lib/libLLVMCore.a(Type.cpp.o): In function `llvm::DerivedType::refineAbstractTypeTo(llvm::Type const*)': Type.cpp:(.text+0x3ce0): undefined reference to `llvm::sys::RWMutex::writer_acquire()' ../../lib/libLLVMCore.a(Type.cpp.o): In function `llvm::StructType::get(std::vector<llvm::Type const*, std::allocator<llvm::Type const*> > const&, bool)': Type.cpp...
2008 Nov 14
3
[LLVMdev] RefineAbstractType
On Wednesday 12 November 2008 19:13, Chris Lattner wrote: > You shouldn't be refining the pointer, you should use: > > t1->refineAbstractType(t2) Ok, I tried this and I get further. But the type system seems to have trouble when refining multiple types and those types resolve to the same thing. I turned on DEBUG_MERGE_TYPES to illustrate: *** First function type ***
2008 Sep 08
0
[LLVMdev] Problems when refining type
On Mon, Sep 8, 2008 at 2:45 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote: > LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); > LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); > LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; > LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); > > Can anyone explain what I'm doing wrong
2008 Oct 03
1
[LLVMdev] Question about recursive types
...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) is // kept up-to-date NewSTy = cast<StructType>(StructTy.get()); // Add a name for the type to the module symbol table (optional) MyModule->addTypeName("mylist", NewSTy); However, it does not work. T...
2010 Jun 14
2
[LLVMdev] Adding fields in a already built type?
Hi, We build a type with StructType::get(fModule->getContext(), fDspFields, false); with a fDspFields (std::vector<const llvm::Type*> fDspFields;) that is not yet completely known when we have to build the type. It is possible to add fields in a already build type? Thanks Stéphane Letz
2010 Jun 14
0
[LLVMdev] Adding fields in a already built type?
On Jun 14, 2010, at 1:22 PM, Stéphane Letz wrote: > Hi, > > We build a type with StructType::get(fModule->getContext(), fDspFields, false); with a fDspFields (std::vector<const llvm::Type*> fDspFields;) that is not yet completely known when we have to build the type. It is possible to add fields in a already build type? Nope, types are immutable once created. The only
2003 May 29
0
[LLVMdev] Re: recursive structs (linked list)
...e structures. :) The trick to it is to use an Opaque type like so: // ST1 === struct ST1; OpaqueType *ST1 = OpaqueType::get(); // ST2 === { int, ST1* } StructType *ST2 = StructType::get(make_vector(Type::IntTy, PointerType::get(ST1), 0)); // ST1 === ST2, delete ST1 ST1->refineAbstractTypeTo(ST2);