search for: getalignof

Displaying 17 results from an estimated 17 matches for "getalignof".

2009 Sep 23
2
[LLVMdev] DebugFactory
...InfoBuilder::getAlignment(const Type * type) { > // Calculates the alignment of T using "sizeof({i8, T}) - sizeof > (T)" > return ConstantExpr::getSub( > getSize(StructType::get(Type::Int8Ty, type, NULL)), > getSize(type)); > } Are ConstantExpr::getAlignOf, getSizeOf, and getOffsetOf what you're looking for? Dan
2009 Sep 23
0
[LLVMdev] DebugFactory
...onst Type * type) { >> // Calculates the alignment of T using "sizeof({i8, T}) - sizeof(T)" >> return ConstantExpr::getSub( >> getSize(StructType::get(Type::Int8Ty, type, NULL)), >> getSize(type)); >> } >> > > Are ConstantExpr::getAlignOf, getSizeOf, and getOffsetOf what > you're looking for? > > That will work. Now all I need is for the methods of DIFactory to take a Constant* instead of uint64. -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/piper...
2014 Sep 24
2
[LLVMdev] Runtime alignment
For the size of a type to be calculated at runtime, there is a known trick with gep. Is there any similar trick for determining the alignment of a type at runtime for target-independent IR? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140924/887f8612/attachment.html>
2009 Sep 23
2
[LLVMdev] DebugFactory
...>>>    // Calculates the alignment of T using "sizeof({i8, T}) - sizeof(T)" >>>    return ConstantExpr::getSub( >>>        getSize(StructType::get(Type::Int8Ty, type, NULL)), >>>        getSize(type)); >>> } >> >> Are ConstantExpr::getAlignOf, getSizeOf, and getOffsetOf what >> you're looking for? >> > That will work. Now all I need is for the methods of DIFactory to take a > Constant* instead of uint64. ok. Feel free to add /// CreateBasicType - Create a basic type like int, float, etc. DIBasicType Create...
2010 Nov 09
2
[LLVMdev] Next round of DWARF issues/questions
...ss_type : > dwarf::DW_TAG_structure_type, > dbgCompileUnit_, > type->typeDefn()->linkageName().c_str(), > genDIFile(type->typeDefn()), > getSourceLineNumber(type->typeDefn()->location()), > getSizeOfInBits(type->irType()), > getAlignOfInBits(type->irType()), > getInt64Val(0), 0, > DIType(), > dbgFactory_.GetOrCreateArray(members.data(), members.size())); > > The 'getSizeOfInBits()' function and the others like it basically call > llvm::ConstantExpr::getSizeOf() and then multiple the...
2010 Nov 09
0
[LLVMdev] Next round of DWARF issues/questions
..._TAG_structure_type, >> dbgCompileUnit_, >> type->typeDefn()->linkageName().c_str(), >> genDIFile(type->typeDefn()), >> getSourceLineNumber(type->typeDefn()->location()), >> getSizeOfInBits(type->irType()), >> getAlignOfInBits(type->irType()), >> getInt64Val(0), 0, >> DIType(), >> dbgFactory_.GetOrCreateArray(members.data(), members.size())); >> >> The 'getSizeOfInBits()' function and the others like it basically call llvm::ConstantExpr::getSizeOf() and t...
2011 Feb 04
3
[LLVMdev] ConstantBuilder proposal
...NULL. static Constant *GetStruct( LLVMContext &Context, Constant * Val, ...) END_WITH_NULL; //===--------------------------------------------------------------------===// // Constant expressions //===--------------------------------------------------------------------===// /// GetAlignOf constant expr - computes the alignment of a type in a target /// independent way (Note: the return type is an i64). static Constant *GetAlignOf(const Type* Ty) { return ConstantExpr::getAlignOf(Ty); } /// GetSizeOf constant expr - computes the (alloc) size of a type (in /// address-u...
2010 May 08
0
[LLVMdev] does llvm have some way to get the size of data type
Hello! You can do this: http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt On Fri, May 7, 2010 at 8:26 PM, Gang.Yao <ttoole9 at gmail.com> wrote: > Hi: > > just like the c function sizeof(). I would avoid the usage of the c > function call, and expect something like llvm > intrinsic or some class providing this functionality. > > Does someone
2009 Oct 02
0
[LLVMdev] DebugFactory
...the alignment of T using "sizeof({i8, T}) - sizeof(T)" > >>> return ConstantExpr::getSub( > >>> getSize(StructType::get(Type::Int8Ty, type, NULL)), > >>> getSize(type)); > >>> } > >> > >> Are ConstantExpr::getAlignOf, getSizeOf, and getOffsetOf what > >> you're looking for? > >> > > That will work. Now all I need is for the methods of DIFactory to take a > > Constant* instead of uint64. > > ok. Feel free to add > /// CreateBasicType - Create a basic type like int, f...
2010 May 08
5
[LLVMdev] does llvm have some way to get the size of data type
Hi: just like the c function sizeof(). I would avoid the usage of the c function call, and expect something like llvm intrinsic or some class providing this functionality. Does someone have experience in this? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100507/056bae50/attachment.html>
2010 Nov 26
3
[LLVMdev] Next round of DWARF issues/questions
..._TAG_structure_type, >> dbgCompileUnit_, >> type->typeDefn()->linkageName().c_str(), >> genDIFile(type->typeDefn()), >> getSourceLineNumber(type->typeDefn()->location()), >> getSizeOfInBits(type->irType()), >> getAlignOfInBits(type->irType()), >> getInt64Val(0), 0, >> DIType(), >> dbgFactory_.GetOrCreateArray(members.data(), members.size())); >> >> The 'getSizeOfInBits()' function and the others like it basically call >> llvm::ConstantExpr::getSizeOf(...
2009 Sep 22
0
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>wrote: > On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com> > wrote: > > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote: > >> So, one feature of the late, lamented DebugInfoBuilder that I am missing > >> quite badly, and which is not
2009 Sep 22
3
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com> wrote: > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote: >> So, one feature of the late, lamented DebugInfoBuilder that I am missing >> quite badly, and which is not available in the current DIFactory, is the >> ability to specify structure offsets abstractly. The
2009 Jun 18
5
[LLVMdev] Explicitly Freeing Allocas
Hello, I would just like to ask if it's possible to explicitly free allocas. This is because I need to call functions that take structs of different sizes as input, (possibly inside of loops) and I would rather avoid a stack overflow. If this is not possible, an alternate solution would be for me to allocate an array of bytes larger than all the struct types I may be using, and cast that
2010 Nov 26
0
[LLVMdev] Next round of DWARF issues/questions
...;>> dbgCompileUnit_, >>> type->typeDefn()->linkageName().c_str(), >>> genDIFile(type->typeDefn()), >>> getSourceLineNumber(type->typeDefn()->location()), >>> getSizeOfInBits(type->irType()), >>> getAlignOfInBits(type->irType()), >>> getInt64Val(0), 0, >>> DIType(), >>> dbgFactory_.GetOrCreateArray(members.data(), members.size())); >>> >>> The 'getSizeOfInBits()' function and the others like it basically call >>> llvm::...
2010 Nov 08
0
[LLVMdev] Next round of DWARF issues/questions
...G_class_type : dwarf::DW_TAG_structure_type, > dbgCompileUnit_, > type->typeDefn()->linkageName().c_str(), > genDIFile(type->typeDefn()), > getSourceLineNumber(type->typeDefn()->location()), > getSizeOfInBits(type->irType()), > getAlignOfInBits(type->irType()), > getInt64Val(0), 0, > DIType(), > dbgFactory_.GetOrCreateArray(members.data(), members.size())); > > The 'getSizeOfInBits()' function and the others like it basically call llvm::ConstantExpr::getSizeOf() and then multiple the res...
2010 Nov 07
3
[LLVMdev] Next round of DWARF issues/questions
...== Type::Class ? dwarf::DW_TAG_class_type : dwarf::DW_TAG_structure_type, dbgCompileUnit_, type->typeDefn()->linkageName().c_str(), genDIFile(type->typeDefn()), getSourceLineNumber(type->typeDefn()->location()), getSizeOfInBits(type->irType()), getAlignOfInBits(type->irType()), getInt64Val(0), 0, DIType(), dbgFactory_.GetOrCreateArray(members.data(), members.size())); The 'getSizeOfInBits()' function and the others like it basically call llvm::ConstantExpr::getSizeOf() and then multiple the result by 8. Looking at the g...