| 1 |
|
| 2 |
/* Compiler implementation of the D programming language |
| 3 |
* Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved |
| 4 |
* written by Walter Bright |
| 5 |
* https://www.digitalmars.com |
| 6 |
* Distributed under the Boost Software License, Version 1.0. |
| 7 |
* https://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 |
extern bool includeImports; |
| 26 |
// array of module patterns used to include/exclude imported modules |
| 27 |
extern Array<const char*> includeModulePatterns; |
| 28 |
extern Array<Module *> compiledImports; |
| 29 |
|
| 30 |
struct Compiler |
| 31 |
{ |
| 32 |
// CTFE support for cross-compilation. |
| 33 |
static Expression *paintAsType(UnionExp *, Expression *, Type *); |
| 34 |
// Backend |
| 35 |
static bool onImport(Module *); |
| 36 |
static void onParseModule(Module *); |
| 37 |
}; |