d: Merge upstream dmd 568496d5b, druntime 178c44ff, phobos 574bf883b.
[official-gcc.git] / gcc / d / dmd / gluelayer.d
blob4018126cb262898212b111e86c6350f9af3dad2c
1 /**
2 * Declarations for back-end functions that the front-end invokes.
4 * This 'glues' either the DMC or GCC back-end to the front-end.
6 * Copyright: Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
7 * Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
8 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
9 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/gluelayer.d, _gluelayer.d)
10 * Documentation: https://dlang.org/phobos/dmd_gluelayer.html
11 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/gluelayer.d
14 module dmd.gluelayer;
16 import dmd.dmodule;
17 import dmd.dscope;
18 import dmd.dsymbol;
19 import dmd.mtype;
20 import dmd.statement;
21 import dmd.root.file;
23 version (NoBackend)
25 struct Symbol;
26 struct code;
27 struct block;
28 struct Blockx;
29 struct elem;
30 struct TYPE;
31 alias type = TYPE;
33 extern (C++)
35 // iasm
36 Statement asmSemantic(AsmStatement s, Scope* sc)
38 sc.func.hasReturnExp = 8;
39 return null;
42 // toir
43 void toObjFile(Dsymbol ds, bool multiobj) {}
45 extern(C++) abstract class ObjcGlue
47 static void initialize() {}
51 else version (MARS)
53 public import dmd.backend.cc : block, Blockx, Symbol;
54 public import dmd.backend.type : type;
55 public import dmd.backend.el : elem;
56 public import dmd.backend.code_x86 : code;
58 extern (C++)
60 Statement asmSemantic(AsmStatement s, Scope* sc);
62 void toObjFile(Dsymbol ds, bool multiobj);
64 extern(C++) abstract class ObjcGlue
66 static void initialize();
70 else version (IN_GCC)
72 extern (C++) union tree_node;
74 alias Symbol = tree_node;
75 alias code = tree_node;
76 alias type = tree_node;
78 extern (C++)
80 Statement asmSemantic(AsmStatement s, Scope* sc);
81 void toObjFile(Dsymbol ds, bool multiobj);
84 // stubs
85 extern(C++) abstract class ObjcGlue
87 static void initialize() {}
90 else
91 static assert(false, "Unsupported compiler backend");