aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/ldc.js
diff options
context:
space:
mode:
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) {