aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/ispc.js
diff options
context:
space:
mode:
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;
}