aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/ispc.js
diff options
context:
space:
mode:
authorpartouf <partouf@gmail.com>2022-05-12 16:54:43 +0200
committerpartouf <partouf@gmail.com>2022-05-12 16:54:43 +0200
commitbb8f3b8c9a7cefeeada15d4811765e281681352c (patch)
treef6a55027ac73736895d3e4a6faa233514a9f3888 /lib/compilers/ispc.js
parentcb7a772e4a64f2c1c78725aef8b1d6687884456e (diff)
parentbd362118e0d2c1e3fbab52f32cb9090b833ba2b5 (diff)
downloadcompiler-explorer-bb8f3b8c9a7cefeeada15d4811765e281681352c.tar.gz
compiler-explorer-bb8f3b8c9a7cefeeada15d4811765e281681352c.zip
Merge branches 'bbcmicrothings' and 'main' of https://github.com/compiler-explorer/compiler-explorer into main
Diffstat (limited to 'lib/compilers/ispc.js')
-rw-r--r--lib/compilers/ispc.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/compilers/ispc.js b/lib/compilers/ispc.js
index 8c1481b8a..897c0976f 100644
--- a/lib/compilers/ispc.js
+++ b/lib/compilers/ispc.js
@@ -22,7 +22,11 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import Semver from 'semver';
+import _ from 'underscore';
+
import {BaseCompiler} from '../base-compiler';
+import {asSafeVer} from '../utils';
import {ISPCParser} from './argument-parsers';
@@ -37,6 +41,10 @@ export class ISPCCompiler extends BaseCompiler {
this.compiler.irArg = ['--emit-llvm-text'];
}
+ couldSupportASTDump(version) {
+ return Semver.gte(asSafeVer(this.compiler.semver), '1.18.0', true);
+ }
+
optionsForFilter(filters, outputFilename) {
let options = ['--target=avx2-i32x8', '--emit-asm', '-g', '-o', this.filename(outputFilename)];
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
@@ -54,6 +62,19 @@ export class ISPCCompiler extends BaseCompiler {
return ISPCParser;
}
+ async generateAST(inputFilename, options) {
+ // These options make Clang produce an AST dump
+ const newOptions = _.filter(options, option => option !== '--colored-output').concat(['--ast-dump']);
+
+ const execOptions = this.getDefaultExecOptions();
+ // A higher max output is needed for when the user includes headers
+ execOptions.maxOutput = 1024 * 1024 * 1024;
+
+ return this.llvmAst.processAst(
+ await this.runCompiler(this.compiler.exe, newOptions, this.filename(inputFilename), execOptions),
+ );
+ }
+
isCfgCompiler(/*compilerVersion*/) {
return true;
}