aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/haskell.js
diff options
context:
space:
mode:
authorA S E <adam@sandbergericsson.se>2022-04-28 15:53:11 +0100
committerGitHub <noreply@github.com>2022-04-28 09:53:11 -0500
commit943af8f831fa52b68d6b17726d42659c9ae1cb84 (patch)
treeb8ee40d0f45d17a38f38854d304cf550bf1f5b31 /lib/compilers/haskell.js
parent3cf18aa09ab01a19a3dde28cf18a02c13783aaf7 (diff)
downloadcompiler-explorer-gh-2669.tar.gz
compiler-explorer-gh-2669.zip
add a view for Haskell STG intermediary output #3571 (#3585)gh-2669
Diffstat (limited to 'lib/compilers/haskell.js')
-rw-r--r--lib/compilers/haskell.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/compilers/haskell.js b/lib/compilers/haskell.js
index e55bb37a4..413185a2e 100644
--- a/lib/compilers/haskell.js
+++ b/lib/compilers/haskell.js
@@ -22,28 +22,40 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import { BaseCompiler } from '../base-compiler';
+import path from 'path';
-import { ClangParser } from './argument-parsers';
+import {BaseCompiler} from '../base-compiler';
+
+import {ClangParser} from './argument-parsers';
export class HaskellCompiler extends BaseCompiler {
static get key() {
return 'haskell';
}
+ constructor(info, env) {
+ super(info, env);
+ this.compiler.supportsHaskellStgView = true;
+ }
+
+ optionsForBackend(backendOptions, outputFilename) {
+ const opts = super.optionsForBackend(backendOptions, outputFilename);
+
+ if (backendOptions.produceHaskellStg && this.compiler.supportsHaskellStgView) {
+ opts.push('-ddump-to-file', '-dumpdir', path.dirname(outputFilename), '-ddump-stg-final');
+ }
+ return opts;
+ }
+
optionsForFilter(filters, outputFilename) {
const options = ['-g', '-o', this.filename(outputFilename)];
- if (!filters.binary)
- options.unshift('-S');
+ if (!filters.binary) options.unshift('-S');
return options;
}
getSharedLibraryPathsAsArguments(libraries) {
const libPathFlag = this.compiler.libpathFlag || '-L';
- return [
- libPathFlag + '.',
- ...this.getSharedLibraryPaths(libraries).map(path => libPathFlag + path),
- ];
+ return [libPathFlag + '.', ...this.getSharedLibraryPaths(libraries).map(path => libPathFlag + path)];
}
getArgumentParser() {