Skip to content

Commit

Permalink
Merge pull request #1623 from ibuclaw/tvalist
Browse files Browse the repository at this point in the history
Add tvalist for keeping reference of target va_list type.
  • Loading branch information
yebblies committed Feb 5, 2013
2 parents cac4410 + bf087c2 commit 57bf30b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/func.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/mtype.c
Expand Up @@ -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];
Expand Down Expand Up @@ -281,6 +282,7 @@ void Type::init()

tvoidptr = tvoid->pointerTo();
tstring = tchar->invariantOf()->arrayOf();
tvalist = tvoid->pointerTo();

if (global.params.is64bit)
{
Expand Down
1 change: 1 addition & 0 deletions src/mtype.h
Expand Up @@ -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
Expand Down

0 comments on commit 57bf30b

Please sign in to comment.