similar to: [LLVMdev] Building a new struct type, etc

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] Building a new struct type, etc"

2005 Aug 24
1
[LLVMdev] CallInst constructor interface
Hi, Inserting a call instruction is a bit of a pain. The only way I know how to do it is to write a bunch of code like the following: std::vector<const Type*> formalArgs; formalArgs.push_back(arg1->getType()); formalArgs.push_back(arg2->getType()); ... formalArgs.push_back(argn->getType()); std::vector<Value*> args; args.push_back(arg1);
2005 Apr 11
2
[LLVMdev] JIT and array pointers
On Sun, 2005-04-10 at 19:47 -0500, Chris Lattner wrote: > On Mon, 11 Apr 2005, Paul wrote: > > I'm trying to pass an array pointer to my run-time generated module, and > > after a long time of searching for the answer, the only thing I got was > > a headache. Basically I have a few arrays (few megabytes which will > > sometimes be accessed as 8 / 16 / 32 / 64 bit
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 ;
2005 Mar 09
4
[LLVMdev] Recursive Types using the llvm support library
----- Original Message ----- From: "Chris Lattner" <sabre at nondot.org> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Sent: Tuesday, March 08, 2005 6:31 PM Subject: Re: [LLVMdev] Recursive Types using the llvm support library > On Tue, 8 Mar 2005, Vladimir Merzliakov wrote: > >>>> An example where something really simple like the
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
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, dummy1 at boxpl.com wrote: >> There are many possible ways to do this, can you be a bit more specific >> about what you're trying to do? > Here is a basic example: Ah, ok, I see what you're trying to do. Below is some *pseudo* code for the basic idea: > ============================================ > unsigned int buff[4096]; > > int main
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; :
2005 Apr 10
2
[LLVMdev] JIT and array pointers
I'm trying to pass an array pointer to my run-time generated module, and after a long time of searching for the answer, the only thing I got was a headache. Basically I have a few arrays (few megabytes which will sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that will be modified by both the generated module, and my main c program, so I would like to put those into global
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
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, Paul wrote: > I'm trying to pass an array pointer to my run-time generated module, and > after a long time of searching for the answer, the only thing I got was > a headache. Basically I have a few arrays (few megabytes which will > sometimes be accessed as 8 / 16 / 32 / 64 bit binary / fp values), that > will be modified by both the generated module, and my
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
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha, Thanks for your answer I was doing this: ======================== BasicBlock *BBlock = new BasicBlock("entry", MyFunc); ... Value *Zero = ConstantSInt::get(Type::IntTy, 0); Value *UZero = ConstantUInt::get(Type::UIntTy, 0); MallocInst* mi = new MallocInst( STyStru ); mi->setName("tmp.0"); BBlock->getInstList().push_back( mi );
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 =
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*
2006 May 01
0
[LLVMdev] printf decleration
Ok, I think I figured it out. I talked to someone, and we figured out that when I make a call to printf with a constant string, I need to make a global variable and use getElementPtr to reference it. The modified call for accessing the printf is: /* m is Module*, f is Function*, i is Instruction* */ Constant* constStr = ConstantArray::get("test\n"); GlobalVariable* gv =
2006 Jun 25
1
[LLVMdev] adding args to func call
This question is similar to Ryan Lefever's post on May 1, 2006 about printf declaration. In my case, I want to insert fprintf(stderr, ...) calls. I'm new to LLVM, and I don't know what's the recipe for putting together the arguments. Can someone give me basic instructions or point me in the direction on what to do? I can't find any more documentation on this. Thanks!
2003 May 29
0
[LLVMdev] Re: recursive structs (linked list)
On 28 May 2003, Joel Stanley wrote: > I'm trying to make a struct type that is recursive. How can I do this? It's very non-obvious, but an important lesson in how types in LLVM are represented. In particular, in LLVM, each type shape can only exist once in memory, which allows users to do pointer comparisons to check structural equality of types. Naturally, this makes things
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
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