Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gen: Use single ldc.register_dso function for both module ctor/dtor
This reduces the size of a statically linked Phobos-based Hello World by 11 kB on Linux x86_64. Also creates a header file for gen/module.cpp, which has been renamed to "modules" such as not to conflict with the frontend header file.
- Loading branch information
1 parent
e7c95db
commit d47bdb2
Showing
5 changed files
with
122 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//===-- gen/modules.h - Entry points for D module codegen -------*- C++ -*-===// | ||
// | ||
// LDC – the LLVM D compiler | ||
// | ||
// This file is distributed under the BSD-style LDC license. See the LICENSE | ||
// file for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
struct IRState; | ||
class Module; | ||
|
||
/// Sets the m->*file members to the output file names, as derived from platform | ||
/// and command line switches, making sure that they are valid paths and don't | ||
/// conflict with the source file. | ||
void buildTargetFiles(Module *m, bool singleObj, bool library); | ||
|
||
/// Generates code for the contents of module m into the LLVM module associated | ||
/// with irs. | ||
void codegenModule(IRState *irs, Module *m); |