From bf087c286708c96d8519223a44ab36c47bc937fa Mon Sep 17 00:00:00 2001 From: ibuclaw Date: Tue, 5 Feb 2013 12:52:46 +0000 Subject: [PATCH] Add tvalist for keeping reference of target va_list type. --- src/func.c | 10 +--------- src/mtype.c | 2 ++ src/mtype.h | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/func.c b/src/func.c index 684ca641f0aa..77b218e4cfca 100644 --- a/src/func.c +++ b/src/func.c @@ -25,10 +25,6 @@ #include "template.h" #include "hdrgen.h" -#ifdef IN_GCC -#include "d-dmd-gcc.h" -#endif - /********************************* FuncDeclaration ****************************/ FuncDeclaration::FuncDeclaration(Loc loc, Loc endloc, Identifier *id, StorageClass storage_class, Type *type) @@ -968,11 +964,7 @@ void FuncDeclaration::semantic3(Scope *sc) } if (f->linkage == LINKd || (f->parameters && Parameter::dim(f->parameters))) { // Declare _argptr -#ifdef IN_GCC - t = d_gcc_builtin_va_list_d_type; -#else - t = Type::tvoid->pointerTo(); -#endif + t = Type::tvalist; argptr = new VarDeclaration(0, t, Id::_argptr, NULL); argptr->semantic(sc2); sc2->insert(argptr); diff --git a/src/mtype.c b/src/mtype.c index b045dba74a0e..029f0127d0ce 100644 --- a/src/mtype.c +++ b/src/mtype.c @@ -113,6 +113,7 @@ TemplateDeclaration *Type::rtinfo; Type *Type::tvoidptr; Type *Type::tstring; +Type *Type::tvalist; Type *Type::basic[TMAX]; unsigned char Type::mangleChar[TMAX]; unsigned char Type::sizeTy[TMAX]; @@ -281,6 +282,7 @@ void Type::init() tvoidptr = tvoid->pointerTo(); tstring = tchar->invariantOf()->arrayOf(); + tvalist = tvoid->pointerTo(); if (global.params.is64bit) { diff --git a/src/mtype.h b/src/mtype.h index fd764165cf79..1d4296c5efdc 100644 --- a/src/mtype.h +++ b/src/mtype.h @@ -181,6 +181,7 @@ struct Type : Object #define tindex tsize_t // array/ptr index static Type *tvoidptr; // void* static Type *tstring; // immutable(char)[] + static Type *tvalist; // va_list alias #define terror basic[Terror] // for error recovery #define tnull basic[Tnull] // for null type