aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
authorJohan Engelen <jbc.engelen@gmail.com>2022-07-20 20:42:47 +0200
committerGitHub <noreply@github.com>2022-07-20 20:42:47 +0200
commitd319bca54cb316c8f2d5002214e36a2cf8e2b98f (patch)
tree41b87cd9e08c4aab075bce6c88f36ca6d8b61f26 /lib/compilers
parent2e0c8c140a29656f3eb4e7e5ee35351a58d9fdc4 (diff)
downloadcompiler-explorer-d319bca54cb316c8f2d5002214e36a2cf8e2b98f.tar.gz
compiler-explorer-d319bca54cb316c8f2d5002214e36a2cf8e2b98f.zip
Enable LLVM optimisation pipeline viewer for LDC + ASan symbolizer (#3838)
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() {