Simple performance question from a newcomer

dextorious via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 24 11:15:23 PST 2016


On Wednesday, 24 February 2016 at 03:33:14 UTC, Mike Parker wrote:
> On Tuesday, 23 February 2016 at 20:03:30 UTC, dextorious wrote:
>> For instance, I am still not sure how to make it pass the -O5 
>> switch to the LDC2 compiler and the impression I got from the 
>> documentation is that explicit manual switches can only be 
>> supplied for the DMD compiler.
>
> If you're referring to this:
>
> "Additional flags passed to the D compiler - note that these 
> flags are usually specific to the compiler in use, but a set of 
> flags is automatically translated from DMD to the selected 
> compiler"
>
> My take is that a specific set of flags are automatically 
> translated (so you don't need to make a separate dflags entry 
> for each compiler you support if you only use those flags), but 
> you can pass any compiler-specific flags you need.

There's part of what I'm referring to, yes. There doesn't seem to 
be any documentation on what gets translated and what doesn't.

For the moment, the only way I've found to manually pass specific 
compiler options ("-O5 -singleobj" in my case) is by settings the 
dflags attribute when defining a buildType. However, there 
doesn't seem to be any way to specify different dflags for 
different compilers, so I am forced to introduce separately named 
buildTypes for each compiler. Since I still need to manually 
specify the compiler using the --compiler option when running 
dub, this feels like I'm using a hacky workaround rather than a 
consistently designed CLI. Furthermore, from the documentation, I 
have no idea if what I'm doing is the intended way or just an 
ugly hack around whatever piece of information I've missed.


More information about the Digitalmars-d-learn mailing list