aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers')
-rw-r--r--lib/compilers/ldc.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/compilers/ldc.js b/lib/compilers/ldc.js
index 0d90c2d2b..2ab8e7cce 100644
--- a/lib/compilers/ldc.js
+++ b/lib/compilers/ldc.js
@@ -42,6 +42,26 @@ export class LDCCompiler extends BaseCompiler {
this.compiler.supportsIntel = true;
this.compiler.supportsIrView = true;
this.compiler.irArg = ['-output-ll'];
+
+ this.compiler.supportsLLVMOptPipelineView = true;
+ this.compiler.llvmOptArg = ['--print-after-all', '--print-before-all'];
+ this.compiler.llvmOptModuleScopeArg = ['--print-module-scope'];
+ this.compiler.llvmOptNoDiscardValueNamesArg = []; // LDC does not have a flag for this yet.
+
+ const asanSymbolizerPath = path.join(path.dirname(this.compiler.exe), 'llvm-symbolizer');
+ if (fs.existsSync(asanSymbolizerPath)) {
+ this.asanSymbolizerPath = asanSymbolizerPath;
+ }
+ }
+
+ runExecutable(executable, executeParameters, homeDir) {
+ if (this.asanSymbolizerPath) {
+ executeParameters.env = {
+ ASAN_SYMBOLIZER_PATH: this.asanSymbolizerPath,
+ ...executeParameters.env,
+ };
+ }
+ return super.runExecutable(executable, executeParameters, homeDir);
}
getSharedLibraryPathsAsArguments() {