Bug 12327 – [IMPLEMENTATION] Target fields in frontend should be private to target.c

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-09T05:47:04Z
Last change time
2024-12-13T18:18:08Z
Keywords
GDC
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#18792 →

Comments

Comment #0 by ibuclaw — 2014-03-09T05:47:04Z
There are a number of isXXX fields in mars.h (struct Params). Some do nothing, others control code generation or semantics or the language, others the ABI. In all cases regardless, these should not be public to the frontend, and go against at least GDC's goals to be a platform agnostic compiler. What changes that need to happen are that any place where isLinux, isOSX, is checked in the frontend should be replaced with a Target hook describing the target behaviour, eg vectorSupported (true/false), prefixLabel ("_" on OSX, for instance) - some cod examples I can think of that may need better names. Once this transition has been completed, DMD can make these private to its own target.c - which allows other compiler backends to omit the setting these values in their own glue if they so wish.
Comment #1 by dlang-bugzilla — 2017-06-26T15:49:59Z
(In reply to Iain Buclaw from comment #0) > There are a number of isXXX fields in mars.h (struct Params). N.B. Today these are in src/ddmd/globals.h.
Comment #2 by ibuclaw — 2020-09-06T17:31:59Z
(In reply to Vladimir Panteleev from comment #1) > (In reply to Iain Buclaw from comment #0) > > There are a number of isXXX fields in mars.h (struct Params). > > N.B. Today these are in src/ddmd/globals.h. N.B. Today these are in src/dmd/globals.h.
Comment #3 by robert.schadek — 2024-12-13T18:18:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18792 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB