Allow returning something of type void in a function that returns void
[delight/core.git] / symbol.cc
blob8822e244a1ec200d7bff221d92b3f80a4e74153e
1 /* GDC -- D front-end for GCC
2 Copyright (C) 2004 David Friedman
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "symbol.h"
20 #include "mem.h"
22 Symbol::Symbol()
24 Sident = 0;
25 //Stype = 0;
26 Sclass = SC_INVALID;
27 Sfl = FL_INVALID;
28 Sflags = 0;
30 //Ssymnum = 0;
31 Sdt = 0;
33 //Sstruct = 0;
34 //Sstructalign = 0;
36 Stree = 0; // %% make it NULL-TREE, include d-gcc-include
37 ScontextDecl = 0;
38 Sunique = 0;
39 #if V2
40 SclosureField = 0;
41 #endif
43 thunks = NULL;
44 otherNestedFuncs = NULL;
45 outputStage = NotStarted;
46 frameInfo = NULL;
49 Symbol *
50 symbol_calloc(const char * string)
52 // Need to dup the string because sometimes the string is alloca()'d
54 Symbol * s = new Symbol;
55 s->Sident = mem.strdup(string);
56 return s;
59 Symbol *
60 symbol_name(const char * id, int /*sclass*/, TYPE * /*t*/)
62 // %% Nothing special, just do the same as symbol_calloc
63 // we don't even bother using sclass and t
65 return symbol_calloc(id);
68 Symbol *
69 struct_calloc()
71 return new Symbol;
74 Symbol *
75 symbol_generate(SymbolStorageClass /*sc*/, TYPE * /*type*/)
77 return 0;
80 Thunk::Thunk()
82 offset = 0;
83 symbol = 0;
86 void
87 symbol_func(Symbol * /*sym*/)
93 Symbol *
94 symbol_tree(tree t)
96 Symbol * s = new Symbol;
97 s->Stree = t;
98 return s;