]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/d/dmd/compiler.h
d: Merge upstream dmd 7132b3537
[thirdparty/gcc.git] / gcc / d / dmd / compiler.h
1
2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * http://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * http://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/compiler.h
9 */
10
11 #pragma once
12
13 #include "root/array.h"
14 #include "root/bitarray.h"
15
16 // This file contains a data structure that describes a back-end compiler
17 // and implements compiler-specific actions.
18
19 class Expression;
20 class Module;
21 class Type;
22 struct Scope;
23 struct UnionExp;
24
25 // DMD-generated module `__entrypoint` where the C main resides
26 extern Module *entrypoint;
27 // Module in which the D main is
28 extern Module *rootHasMain;
29
30 extern bool includeImports;
31 // array of module patterns used to include/exclude imported modules
32 extern Array<const char*> includeModulePatterns;
33 extern Array<Module *> compiledImports;
34
35 struct Compiler
36 {
37 // CTFE support for cross-compilation.
38 static Expression *paintAsType(UnionExp *, Expression *, Type *);
39 // Backend
40 static void genCmain(Scope *);
41 static bool onImport(Module *);
42 static void onParseModule(Module *);
43 };