Support both the global post-process and the per-compiler post-process

dev/git-series/gccdum
Matt Godbolt 7 years ago
parent a395eef44a
commit 8165cd456d

@ -254,7 +254,10 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
var compileToAsmPromise = tempFileAndDirPromise.then(function (info) {
var inputFilename = info.inputFilename;
var dirPath = info.dirPath;
var postProcess = compilerInfo.postProcess;
var postProcess = [compilerProps("postProcess"), compilerInfo.postProcess];
postProcess = postProcess.filter(function (x) {
return x;
});
var outputFilename = path.join(dirPath, 'output.S');
if (compilerInfo.options) {
options = options.concat(compilerInfo.options.split(" "));
@ -296,9 +299,9 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
result.asm = "<No output: generated assembly was too large (" + stat.size + " > " + maxSize + " bytes)>";
return result;
}
if (postProcess) {
if (postProcess.length) {
return new Promise(function (resolve) {
child_process.exec('cat "' + outputFilename + '" | ' + postProcess,
child_process.exec('cat "' + outputFilename + '" | ' + postProcess.join(" | "),
{maxBuffer: maxSize},
function (err, data) {
if (err)

Loading…
Cancel
Save