aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/ldc.js
diff options
context:
space:
mode:
authorRabsRincon <rubrinbla@gmail.com>2018-03-24 01:38:01 +0100
committerRabsRincon <rubrinbla@gmail.com>2018-03-24 01:38:01 +0100
commit8a38293a22d9f657f8b94a7cf2e31cb9985068d8 (patch)
tree9a238acee8c0acc2cb7b03a77c3d5e1ec2fef8fb /lib/compilers/ldc.js
parentb8be2645beef35ea266d7b795d995b8368893a68 (diff)
downloadcompiler-explorer-8a38293a22d9f657f8b94a7cf2e31cb9985068d8.tar.gz
compiler-explorer-8a38293a22d9f657f8b94a7cf2e31cb9985068d8.zip
Add some logging for missing .cg file
Diffstat (limited to 'lib/compilers/ldc.js')
-rw-r--r--lib/compilers/ldc.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compilers/ldc.js b/lib/compilers/ldc.js
index 33d221814..b94c4bc71 100644
--- a/lib/compilers/ldc.js
+++ b/lib/compilers/ldc.js
@@ -75,7 +75,12 @@ class LDCCompiler extends BaseCompiler {
loadASTOutput(output) {
// Load the AST output from the `.cg` file.
// Demangling is not needed.
- return fs.readFileSync(output.inputFilename.concat(".cg"), 'utf-8');
+ const astFilename = output.inputFilename.concat(".cg");
+ if (!fs.existsSync(astFilename)) {
+ logger.warning(`LDC AST file ${astFilename} requested but it does not exist`);
+ return "";
+ }
+ return fs.readFileSync(astFilename, 'utf-8');
}
processOptOutput(hasOptOutput, optPath, demangle) {