Skip to content

Commit ce5a1ff

Browse files
committed
Move Compiler to own module.
1 parent 5c76d45 commit ce5a1ff

6 files changed

Lines changed: 45 additions & 14 deletions

File tree

src/dmd/compiler.d

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Compiler implementation of the
3+
* $(LINK2 http://www.dlang.org, D programming language).
4+
*
5+
* Copyright: Copyright (c) 1999-2017 by The D Language Foundation, All Rights Reserved
6+
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
7+
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
8+
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/compiler.d, _compiler.d)
9+
*/
10+
11+
module dmd.compiler;
12+
13+
struct Compiler
14+
{
15+
const(char)* vendor; // Compiler backend name
16+
}

src/dmd/compiler.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
/* Compiler implementation of the D programming language
3+
* Copyright (c) 1999-2017 by The D Language Foundation
4+
* All Rights Reserved
5+
* written by Walter Bright
6+
* http://www.digitalmars.com
7+
* Distributed under the Boost Software License, Version 1.0.
8+
* http://www.boost.org/LICENSE_1_0.txt
9+
* https://github.com/dlang/dmd/blob/master/src/compiler.h
10+
*/
11+
12+
#ifndef DMD_COMPILER_H
13+
#define DMD_COMPILER_H
14+
15+
// This file contains a data structure that describes a back-end compiler
16+
// and implements compiler-specific actions.
17+
18+
struct Compiler
19+
{
20+
const char *vendor; // Compiler backend name
21+
};
22+
23+
#endif /* DMD_COMPILER_H */

src/dmd/globals.d

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import core.stdc.stdio;
1919
import dmd.root.array;
2020
import dmd.root.filename;
2121
import dmd.root.outbuffer;
22+
import dmd.compiler;
2223
import dmd.identifier;
2324

2425
template xversion(string s)
@@ -215,11 +216,6 @@ struct Param
215216
const(char)* mapfile;
216217
}
217218

218-
struct Compiler
219-
{
220-
const(char)* vendor; // Compiler backend name
221-
}
222-
223219
alias structalign_t = uint;
224220

225221
// magic value means "match whatever the underlying C compiler does"

src/dmd/globals.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "ctfloat.h"
2020
#include "outbuffer.h"
2121
#include "filename.h"
22+
#include "compiler.h"
2223

2324
// Can't include arraytypes.h here, need to declare these directly.
2425
template <typename TYPE> struct Array;
@@ -200,11 +201,6 @@ struct Param
200201
const char *mapfile;
201202
};
202203

203-
struct Compiler
204-
{
205-
const char *vendor; // Compiler backend name
206-
};
207-
208204
typedef unsigned structalign_t;
209205
// magic value means "match whatever the underlying C compiler does"
210206
// other values are all powers of 2

src/posix.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ endif
283283
######## DMD frontend source files
284284

285285
FRONT_SRCS=$(addsuffix .d, $(addprefix $D/,access aggregate aliasthis apply argtypes arrayop \
286-
arraytypes astcodegen attrib builtin canthrow clone complex cond constfold \
286+
arraytypes astcodegen attrib builtin canthrow clone compiler complex cond constfold \
287287
cppmangle cppmanglewin ctfeexpr dcast dclass declaration delegatize denum dimport \
288288
dinifile dinterpret dmacro dmangle dmodule doc dscope dstruct dsymbol dsymbolsem \
289289
dtemplate dversion escape expression expressionsem func \
@@ -401,7 +401,7 @@ TK_SRC = \
401401
######## CXX header files (only needed for checkcxxheaders)
402402

403403
SRC = $(addprefix $D/, aggregate.h aliasthis.h arraytypes.h \
404-
attrib.h complex_t.h cond.h ctfe.h ctfe.h declaration.h dsymbol.h \
404+
attrib.h compiler.h complex_t.h cond.h ctfe.h ctfe.h declaration.h dsymbol.h \
405405
enum.h errors.h expression.h globals.h hdrgen.h identifier.h \
406406
import.h init.h intrange.h json.h \
407407
mars.h module.h mtype.h nspace.h objc.h \

src/win32.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ DMDMAKE=$(MAKE) -fwin32.mak C=$C TK=$(TK) ROOT=$(ROOT) MAKE="$(MAKE)" HOST_DC="$
150150

151151
# D front end
152152
FRONT_SRCS=$D/access.d $D/aggregate.d $D/aliasthis.d $D/apply.d $D/argtypes.d $D/arrayop.d \
153-
$D/arraytypes.d $D/astcodegen.d $D/attrib.d $D/builtin.d $D/canthrow.d $D/clone.d $D/complex.d \
153+
$D/arraytypes.d $D/astcodegen.d $D/attrib.d $D/builtin.d $D/canthrow.d $D/clone.d $D/compiler.d $D/complex.d \
154154
$D/cond.d $D/constfold.d $D/cppmangle.d $D/cppmanglewin.d $D/ctfeexpr.d $D/dcast.d $D/dclass.d \
155155
$D/declaration.d $D/delegatize.d $D/denum.d $D/dimport.d $D/dinifile.d $D/dinterpret.d \
156156
$D/dmacro.d $D/dmangle.d $D/dmodule.d $D/doc.d $D/dscope.d $D/dstruct.d $D/dsymbol.d $D/dsymbolsem.d \
@@ -208,7 +208,7 @@ ROOT_SRCS=$(ROOT)/aav.d $(ROOT)/array.d $(ROOT)/ctfloat.d $(ROOT)/file.d \
208208

209209
# D front end
210210
SRCS = $D/aggregate.h $D/aliasthis.h $D/arraytypes.h \
211-
$D/attrib.h $D/complex_t.h $D/cond.h $D/ctfe.h $D/ctfe.h $D/declaration.h $D/dsymbol.h \
211+
$D/attrib.h $D/compiler.h $D/complex_t.h $D/cond.h $D/ctfe.h $D/ctfe.h $D/declaration.h $D/dsymbol.h \
212212
$D/enum.h $D/errors.h $D/expression.h $D/globals.h $D/hdrgen.h $D/identifier.h \
213213
$D/import.h $D/init.h $D/intrange.h $D/json.h \
214214
$D/mars.h $D/module.h $D/mtype.h $D/nspace.h $D/objc.h \

0 commit comments

Comments
 (0)