search for: tree_type

Displaying 19 results from an estimated 19 matches for "tree_type".

2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...reeConstantToLLVM::EmitLV_STRING_CST(exp)); + case LABEL_DECL: { + Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); + return LValue(Ptr, DECL_ALIGN(exp) / 8); + } + case COMPLEX_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } + case STRING_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } // Type Conversion. case VIEW_CONVERT_EXPR: return EmitLV_VIEW_CONVERT_EXPR(exp); @@ -1165,9 +1174,11 @@ LValue TreeToLLVM::Emi...
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...uppose. > + case LABEL_DECL: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); > + return LValue(Ptr, DECL_ALIGN(exp) / 8); > + } > + case COMPLEX_CST: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); > + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); > + } > + case STRING_CST: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); > + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); > + } These are all equivalent to using expr_align, right? > @@ -2290,7 +2301,7 @@ Value *TreeToLLVM::EmitLoadOf...
2007 Nov 07
7
[LLVMdev] RFC: llvm-convert.cpp Patch
....0; } Anyway, it turns out that the gimplifier was generating the correct alignment, but it was being overridden in assemble_variable(): /* On some machines, it is good to increase alignment sometimes. */ if (! DECL_USER_ALIGN (decl)) { #ifdef DATA_ALIGNMENT align = DATA_ALIGNMENT (TREE_TYPE (decl), align); #endif #ifdef CONSTANT_ALIGNMENT => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node) align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); #endif } By setting the DECL_USER_ALIGN field, we can get the correct alignment. Comments?...
2007 Jul 17
0
[LLVMdev] Review: minor patches to llvm-gcc-4-2
...fold-const.c =================================================================== --- gcc/fold-const.c (revision 39923) +++ gcc/fold-const.c (working copy) @@ -12942,11 +12942,11 @@ { if ((TREE_CODE (exp) == INDIRECT_REF || TREE_CODE (exp) == ARRAY_REF) - && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE && + && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE /* LLVM LOCAL begin */ #if ENABLE_LLVM /* LLVM extends ARRAY_REF to allow pointers to be the base value. */ - (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == ARRAY_TYPE) + && (...
2006 Sep 12
1
[LLVMdev] ICE in LLVM GCC4 Front End
...t) { - // If this is a subtract, we want to step backwards. - if (Opc == Instruction::Sub) - EltOffset = -EltOffset; - Constant *C = ConstantSInt::get(Type::LongTy, EltOffset); - Value *V = new GetElementPtrInst(LHS, C, "tmp", CurBB); - return CastToType(V, TREE_TYPE(exp)); + // If EltSize exactly divides Offset, then we know that we can turn + // this into a getelementptr instruction. + int64_t EltOffset = Offset/EltSize; + if (EltOffset*EltSize == Offset) { + // If this is a subtract, we want to step backwards. + if (Opc ==...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...at the gimplifier was generating the correct > alignment, but it was being overridden in assemble_variable(): > > /* On some machines, it is good to increase alignment sometimes. */ > if (! DECL_USER_ALIGN (decl)) > { > #ifdef DATA_ALIGNMENT > align = DATA_ALIGNMENT (TREE_TYPE (decl), align); > #endif > #ifdef CONSTANT_ALIGNMENT > => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != > error_mark_node) > align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); > #endif > } > > By setting the DECL_USER_ALIGN field,...
2007 Oct 26
2
[LLVMdev] RFC: llvm-convert.cpp Patch
...world? -bw Index: gcc/llvm-convert.cpp =================================================================== --- gcc/llvm-convert.cpp (revision 43366) +++ gcc/llvm-convert.cpp (working copy) @@ -3020,8 +3020,26 @@ Emit(TREE_OPERAND(exp, 1), LV.Ptr); EmitAggregateCopy(DestLoc, LV.Ptr, TREE_TYPE(exp), isVolatile, false, Alignment); } else if (!isVolatile && TREE_CODE(TREE_OPERAND(exp, 0))!=RESULT_DECL) { - Emit(TREE_OPERAND(exp, 1), LV.Ptr); + // At this point, Alignment is the alignment of the destination + // pointer. It may not match t...
2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
...=================== --- gcc/llvm-convert.cpp (revision 43658) +++ gcc/llvm-convert.cpp (working copy) @@ -758,7 +758,7 @@ } -Value *TreeToLLVM::Emit(tree exp, Value *DestLoc) { +Value *TreeToLLVM::Emit(tree exp, Value *DestLoc, unsigned Alignment) { assert((isAggregateTreeType(TREE_TYPE(exp)) == (DestLoc != 0) || TREE_CODE(exp) == MODIFY_EXPR) && "Didn't pass DestLoc to an aggregate expr, or passed it to scalar!"); @@ -811,7 +811,7 @@ case STRING_CST: case REALPART_EXPR: case IMAGPART_EXPR: - Result = EmitLoadOfLValue(e...
2009 Jun 03
1
[LLVMdev] RFA: Alignment of Strings
...c/gcc/llvm-convert.cpp (working copy) @@ -7418,6 +7418,8 @@ TAI ? TAI->getStringConstantPrefix() : ".str", TheModule); + GV->setAlignment(TYPE_ALIGN(TREE_TYPE(exp))); + if (SlotP) *SlotP = GV; #ifdef LLVM_CSTRING_SECTION // For Darwin, try to put it into the .cstring section.
2009 Nov 13
1
[LLVMdev] dodgy use of c_str()
>From llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp: void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { // Gather location information. expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); DIType TyD = getOrCreateType(TREE_TYPE(decl)); const char *DispName = GV->getNameStr().c_str(); Isn't this use of c_str() dodgy, because the temporary string returned by Gv->getNameStr() will be destroyed at the end of the expression, so it's no longer valid to use the memory pointed to by DispName? Thanks, Jay.
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...he gimplifier was generating the correct > alignment, but it was being overridden in assemble_variable(): > > /* On some machines, it is good to increase alignment sometimes. */ > if (! DECL_USER_ALIGN (decl)) > { > #ifdef DATA_ALIGNMENT > align = DATA_ALIGNMENT (TREE_TYPE (decl), align); > #endif > #ifdef CONSTANT_ALIGNMENT > => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != > error_mark_node) > align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); > #endif > } Not sure I'm getting it, is this Bar itse...
2007 Oct 26
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...convert.cpp > =================================================================== > --- gcc/llvm-convert.cpp (revision 43366) > +++ gcc/llvm-convert.cpp (working copy) > @@ -3020,8 +3020,26 @@ > Emit(TREE_OPERAND(exp, 1), LV.Ptr); > EmitAggregateCopy(DestLoc, LV.Ptr, TREE_TYPE(exp), > isVolatile, false, > Alignment); > } else if (!isVolatile && TREE_CODE(TREE_OPERAND(exp, 0))! > =RESULT_DECL) { > - Emit(TREE_OPERAND(exp, 1), LV.Ptr); > + // At this point, Alignment is the alignment of the destination &gt...
2008 Jul 30
0
[LLVMdev] llvm-gcc fortran bootstrap broken
...E LOCAL begin Radar 5741731, typedefs used in '@try' blocks */ + if (is_volatile_type + && c_dialect_objc () + && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type))) + { + is_volatile_type = 0; + if (TYPE_NAME (type) && TREE_TYPE (TYPE_NAME (type))) + type = TREE_TYPE (TYPE_NAME (type)); + } + /* APPLE LOCAL end Radar 5741731, typedefs used in '@try' blocks */ ^ Using a C language method (c_dialect_objc)!!! How about something like this instead (I have no idea if this works): Index: gcc-4.2.llvm/gcc/...
2009 Feb 19
2
[LLVMdev] please review this fix for PR3510
Please review this patch for PR3510 (and <rdar://problem/6564697>). The bug is a failure to handle a "hole" inside an initialized structure, where the hole may be induced by a designated initializer or by alignment: http://llvm.org/bugs/show_bug.cgi?id=3510 The original code was greatly simplified by using FieldNo to index the LLVM fields and the initializer in
2010 Jan 07
1
[LLVMdev] "Value has wrong type!" on Bool:4 bitfield
...) (((exp)->common.type))->common.code) == VOID_TYPE) || isa<VectorType>(ConvertType(((exp)->common.type))) || Result->getType() == ConvertType(((exp)->common.type))) && "Value has wrong type!"' failed. At this point Result is "i8 1". ConvertType(TREE_TYPE(exp)) is i4. And the code generated for the basic block so far is: entry: %retval = alloca i32 ; <i32*> [#uses=0] %0 = alloca i4 ; <i4*> [#uses=1] %"alloca point" = bitcast i32 0 to i32 ; <i32> [...
2007 Aug 22
0
[LLVMdev] RFC: Patch for CFA on Darwin
...eModule, + Intrinsic::eh_dwarf_cfa), + Builder.CreateIntToPtr(ConstantInt::get(Type::Int32Ty, + cfa_offset), + ConvertType(TREE_TYPE(exp)))); return true; } The reason for it: when going to calculate the CFA in LLVM, the original code was adding an offset of type i32 to a pointer. This is fine if pointers are 32-bits, but we get an assert if the types are different. By converting the cfa_offset to a pointer, we get it to be...
2008 Jul 30
3
[LLVMdev] llvm-gcc fortran bootstrap broken
On x86-64 linux, in stage 2, I get: c++ -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -fno-common -DHAVE_CONFIG_H -o f951 \ fortran/arith.o fortran/array.o fortran/bbt.o fortran/check.o fortran/data.o fortran/decl.o
2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
...t >> alignment, but it was being overridden in assemble_variable(): >> >> /* On some machines, it is good to increase alignment >> sometimes. */ >> if (! DECL_USER_ALIGN (decl)) >> { >> #ifdef DATA_ALIGNMENT >> align = DATA_ALIGNMENT (TREE_TYPE (decl), align); >> #endif >> #ifdef CONSTANT_ALIGNMENT >> => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != >> error_mark_node) >> align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); >> #endif >> } > > Not sure I...
2009 Oct 30
2
[LLVMdev] llvm-gcc-4.2 RELEASE_26 bootstrap failure on Solaris/SPARC - unhandled REAL_TYPE during compilation of '__powitf2'
...at llvm-abi.h:535 Looking into the code of llvm-abi.h, I added the following patch to it: --- /data/LLVM/src/GCC/RELEASE_26/gcc/llvm-abi.h.jnz Thu Oct 29 00:32:52 2009 +++ /data/LLVM/src/GCC/RELEASE_26/gcc/llvm-abi.h Fri Oct 30 13:09:09 2009 @@ -529,7 +529,12 @@ HandleArgument(TREE_TYPE(type), ScalarElts); C.ExitField(); } + } else if (TREE_CODE(type) == REAL_TYPE) { + fprintf(stderr,"unhandled REAL_TYPE!\n"); + assert(0 && "unhandled REAL_TYPE!"); + abort(); } else { + fprintf(stderr,"unknown aggreate...