mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 06:28:02 -06:00
Asyncify dmd
This commit is contained in:
+12
-12
@@ -40,11 +40,12 @@ class DMDCompiler extends BaseCompiler {
|
||||
return ['-g', '-of' + this.filename(outputFilename)];
|
||||
}
|
||||
|
||||
execPostProcess(result, postProcesses, outputFilename, maxSize) {
|
||||
async execPostProcess(result, postProcesses, outputFilename, maxSize) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
const lPath = path.basename(outputFilename);
|
||||
return this.exec(postProcesses[0], ["-l", lPath], {customCwd: dirPath, maxOutput: maxSize})
|
||||
.then(postResult => this.handlePostProcessResult(result, postResult));
|
||||
return this.handlePostProcessResult(
|
||||
result,
|
||||
await this.exec(postProcesses[0], ["-l", lPath], {customCwd: dirPath, maxOutput: maxSize}));
|
||||
}
|
||||
|
||||
getOutputFilename(dirPath, outputFilebase) {
|
||||
@@ -57,19 +58,18 @@ class DMDCompiler extends BaseCompiler {
|
||||
return this.runCompiler(compiler, options, inputFilename, execOptions);
|
||||
}
|
||||
|
||||
objdump(outputFilename, result, maxSize, intelAsm, demangle) {
|
||||
async objdump(outputFilename, result, maxSize, intelAsm, demangle) {
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
let args = ["-d", outputFilename, "-l", "--insn-width=16"];
|
||||
if (demangle) args = args.concat("-C");
|
||||
if (intelAsm) args = args.concat(["-M", "intel"]);
|
||||
return this.exec(this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath})
|
||||
.then(objResult => {
|
||||
result.asm = objResult.stdout;
|
||||
if (objResult.code !== 0) {
|
||||
result.asm = `<No output: objdump returned ${objResult.code}>`;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
const objResult = await this.exec(
|
||||
this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath});
|
||||
result.asm = objResult.stdout;
|
||||
if (objResult.code !== 0) {
|
||||
result.asm = `<No output: objdump returned ${objResult.code}>`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
getArgumentParser() {
|
||||
|
||||
Reference in New Issue
Block a user