Bug 19110 – [internal] Provide interface for implementing vendor-specific pragmas

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-07-22T18:44:16Z
Last change time
2024-12-13T18:59:46Z
Assigned to
Iain Buclaw
Creator
Iain Buclaw
See also
https://issues.dlang.org/show_bug.cgi?id=22953
Moved to GitHub: dmd#19463 →

Comments

Comment #0 by ibuclaw — 2018-07-22T18:44:16Z
The only way to add new vendor-specific pragmas is by modifying the front-end sources. Proposed: /** * Checks whether the target/compiler supports the given pragma. * Params: * ident = name of the pragma * args = arguments to pass to pragma * statement = true if analysing a PragmaStatement. */ bool isPragmaSupported(Identifier ident, Expressions* args, bool statement) { // Implemented in Target::isPragmaSupported(). return false; } Example usage: In dsymbolsem.d / statementsem.d: else if (Target.isPragmaSupported(pd.ident, pd.args, false)) { // Handled by backend. } else if (global.params.ignoreUnsupportedPragmas) { // Ignored on command-line. } else pd.error("unrecognized pragma %s", pd.ident.toChars());
Comment #1 by robert.schadek — 2024-12-13T18:59:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19463 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB