Bug 15374 – [internal] Nothing should import ddmd.mars

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-22T13:15:16Z
Last change time
2018-10-01T22:20:46Z
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2015-11-22T13:15:16Z
These modules all import ddmd.mars. ddmd.attrib ddmd.cond ddmd.dimport ddmd.doc ddmd.expression ddmd.func ddmd.hdrgen Because these four functions are defined there: readFile writeFile ensurePathToNameExists escapePath As ddmd.mars is the main function, nothing should be importing it. These helper/utility functions should either be moved elsewhere or put in it's own module. This is a foreseeable blocker for switching to the new D frontend, as the main function is defined elsewhere in GDC, possibly LDC too?
Comment #1 by code — 2015-11-22T14:58:36Z
Yep, we (LDC) define our own main() too.
Comment #2 by ibuclaw — 2015-11-22T21:25:20Z
Thanks for clarifying, Raised PR here. Feel free to direct your opinion on how things should be handled. https://github.com/D-Programming-Language/dmd/pull/5282
Comment #3 by ibuclaw — 2017-11-08T21:47:11Z
Only ddmd.func remains in the original list. Need to find a new home for genCmain.
Comment #4 by github-bugzilla — 2018-10-01T22:20:45Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b8655054d09c4a451b2aef4fc68118a6883f7f89 fix Issue 15374 - Move genCmain into Compiler struct. https://github.com/dlang/dmd/commit/11573d214097d3fcb7eeb388eba0f6ddf8335694 Merge pull request #7534 from ibuclaw/issue15374 fix Issue 15374 - Move genCmain into Compiler struct. merged-on-behalf-of: Iain Buclaw <[email protected]>