comparison dmd/mtype.c @ 445:cc40db549aea

Changed the handling of variadic intrinsics a bit. Removed the -fp80 option and made real be 80bit floats on X86, this is what the D spec really says it should be and fixes a bunch of issues. Changed the handling of parameter attributes to a bit more generalized approach. Added sext/zext attributes for byte/short/ubyte/ushort parameters, fixes #60 . Parameter attribs now properly set for intrinsic calls if necessary. Made the tango.math.Math patch less intrusive. Fixed/added some mini tests.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 01 Aug 2008 17:59:58 +0200
parents 722f5e90c39c
children a34078905d01
comparison
equal deleted inserted replaced
444:f2b5f86348ef 445:cc40db549aea
250 Tptrdiff_t = Tint32; 250 Tptrdiff_t = Tint32;
251 PTRSIZE = 4; 251 PTRSIZE = 4;
252 } 252 }
253 253
254 // set real size and padding 254 // set real size and padding
255 if (global.params.useFP80) 255 if (global.params.cpu == ARCHx86)
256 { 256 {
257 REALSIZE = 12; 257 REALSIZE = 12;
258 REALPAD = 2; 258 REALPAD = 2;
259 } 259 }
260 else 260 else
2651 this->varargs = varargs; 2651 this->varargs = varargs;
2652 this->linkage = linkage; 2652 this->linkage = linkage;
2653 this->inuse = 0; 2653 this->inuse = 0;
2654 this->llvmRetInPtr = false; 2654 this->llvmRetInPtr = false;
2655 this->llvmUsesThis = false; 2655 this->llvmUsesThis = false;
2656 this->llvmRetAttrs = 0;
2656 } 2657 }
2657 2658
2658 Type *TypeFunction::syntaxCopy() 2659 Type *TypeFunction::syntaxCopy()
2659 { 2660 {
2660 Type *treturn = next ? next->syntaxCopy() : NULL; 2661 Type *treturn = next ? next->syntaxCopy() : NULL;
2661 Arguments *params = Argument::arraySyntaxCopy(parameters); 2662 Arguments *params = Argument::arraySyntaxCopy(parameters);
2662 TypeFunction *t = new TypeFunction(params, treturn, varargs, linkage); 2663 TypeFunction *t = new TypeFunction(params, treturn, varargs, linkage);
2663 t->llvmRetInPtr = llvmRetInPtr; 2664 t->llvmRetInPtr = llvmRetInPtr;
2664 t->llvmUsesThis = llvmUsesThis; 2665 t->llvmUsesThis = llvmUsesThis;
2666 t->llvmRetAttrs = llvmRetAttrs;
2665 return t; 2667 return t;
2666 } 2668 }
2667 2669
2668 /******************************* 2670 /*******************************
2669 * Returns: 2671 * Returns:
5233 { 5235 {
5234 this->type = type; 5236 this->type = type;
5235 this->ident = ident; 5237 this->ident = ident;
5236 this->storageClass = storageClass; 5238 this->storageClass = storageClass;
5237 this->defaultArg = defaultArg; 5239 this->defaultArg = defaultArg;
5238 this->llvmByVal = false; 5240 this->llvmAttrs = 0;
5239 } 5241 }
5240 5242
5241 Argument *Argument::syntaxCopy() 5243 Argument *Argument::syntaxCopy()
5242 { 5244 {
5243 Argument *a = new Argument(storageClass, 5245 Argument *a = new Argument(storageClass,
5244 type ? type->syntaxCopy() : NULL, 5246 type ? type->syntaxCopy() : NULL,
5245 ident, 5247 ident,
5246 defaultArg ? defaultArg->syntaxCopy() : NULL); 5248 defaultArg ? defaultArg->syntaxCopy() : NULL);
5247 a->llvmByVal = llvmByVal; 5249 a->llvmAttrs = llvmAttrs;
5248 return a; 5250 return a;
5249 } 5251 }
5250 5252
5251 Arguments *Argument::arraySyntaxCopy(Arguments *args) 5253 Arguments *Argument::arraySyntaxCopy(Arguments *args)
5252 { Arguments *a = NULL; 5254 { Arguments *a = NULL;