aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/config/typescript.amazon.properties11
-rw-r--r--etc/config/typescript.defaults.properties8
-rw-r--r--lib/compilers/typescript-native.ts14
3 files changed, 25 insertions, 8 deletions
diff --git a/etc/config/typescript.amazon.properties b/etc/config/typescript.amazon.properties
index 984a619e5..2667b2f4e 100644
--- a/etc/config/typescript.amazon.properties
+++ b/etc/config/typescript.amazon.properties
@@ -2,7 +2,7 @@ compilers=&tsnative
compilerType=typescript
versionFlag=--version
-group.tsnative.compilers=tsc_0_0_20_gc:tsc_0_0_20_nogc:tsc_0_0_26_gc:tsc_0_0_26_nogc:tsc_0_0_27_gc:tsc_0_0_27_nogc
+group.tsnative.compilers=tsc_0_0_20_gc:tsc_0_0_20_nogc:tsc_0_0_26_gc:tsc_0_0_26_nogc:tsc_0_0_27_gc:tsc_0_0_27_nogc:tsc_0_0_33_gc:tsc_0_0_33_nogc
group.tsnative.sharedlibs=
group.tsnative.isSemVer=true
compiler.tsc_0_0_20_gc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha20/bin/tsc
@@ -26,8 +26,15 @@ compiler.tsc_0_0_27_gc.semver=0.0.27
compiler.tsc_0_0_27_nogc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha27/bin/tsc
compiler.tsc_0_0_27_nogc.name=TypeScript Native Compiler 0.0.pre27 JIT (No GC)
compiler.tsc_0_0_27_nogc.semver=0.0.27
+compiler.tsc_0_0_33_gc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha33/bin/tsc
+compiler.tsc_0_0_33_gc.sharedlibs=/opt/compiler-explorer/tsc-0.0-pre-alpha33/lib/libTypeScriptRuntime.so
+compiler.tsc_0_0_33_gc.name=TypeScript Native Compiler 0.0.pre33 JIT (GC)
+compiler.tsc_0_0_33_gc.semver=0.0.33
+compiler.tsc_0_0_33_nogc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha33/bin/tsc
+compiler.tsc_0_0_33_nogc.name=TypeScript Native Compiler 0.0.pre33 JIT (No GC)
+compiler.tsc_0_0_33_nogc.semver=0.0.33
-defaultCompiler=tsc_0_0_27_gc
+defaultCompiler=tsc_0_0_33_gc
supportsBinary=false
supportsExecute=true
interpreted=true
diff --git a/etc/config/typescript.defaults.properties b/etc/config/typescript.defaults.properties
index 00db6de55..69c075c0a 100644
--- a/etc/config/typescript.defaults.properties
+++ b/etc/config/typescript.defaults.properties
@@ -4,12 +4,14 @@ compilerType=typescript
versionFlag=--version
group.tsnative.compilers=tsc_jit_gc:tsc_jit_nogc
-compiler.tsc_jit_gc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha27/bin/tsc
-compiler.tsc_jit_gc.sharedlibs=/opt/compiler-explorer/tsc-0.0-pre-alpha27/lib/libTypeScriptRuntime.so
+compiler.tsc_jit_gc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha33/bin/tsc
+compiler.tsc_jit_gc.sharedlibs=/opt/compiler-explorer/tsc-0.0-pre-alpha33/lib/libTypeScriptRuntime.so
compiler.tsc_jit_gc.name=TypeScript Native Compiler JIT (GC)
-compiler.tsc_jit_nogc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha27/bin/tsc
+compiler.tsc_jit_gc.semver=0.0.33
+compiler.tsc_jit_nogc.exe=/opt/compiler-explorer/tsc-0.0-pre-alpha33/bin/tsc
compiler.tsc_jit_nogc.sharedlibs=
compiler.tsc_jit_nogc.name=TypeScript Native Compiler JIT (No GC)
+compiler.tsc_jit_nogc.semver=0.0.33
defaultCompiler=tsc_jit_gc
supportsBinary=false
diff --git a/lib/compilers/typescript-native.ts b/lib/compilers/typescript-native.ts
index 32017f66b..d450bcb94 100644
--- a/lib/compilers/typescript-native.ts
+++ b/lib/compilers/typescript-native.ts
@@ -22,10 +22,13 @@
// 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 type {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js';
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
import {BaseCompiler} from '../base-compiler.js';
+import {asSafeVer} from '../utils.js';
import {TypeScriptNativeParser} from './argument-parsers.js';
@@ -36,6 +39,7 @@ export class TypeScriptNativeCompiler extends BaseCompiler {
tscJit: string;
tscSharedLib: string;
+ tscNewOutput: boolean;
constructor(compilerInfo: PreliminaryCompilerInfo, env) {
super(compilerInfo, env);
@@ -43,8 +47,9 @@ export class TypeScriptNativeCompiler extends BaseCompiler {
this.compiler.supportsIntel = false;
this.compiler.supportsIrView = true;
- this.tscJit = this.compilerProps<string>(`compiler.${this.compiler.id}.exe`);
+ this.tscJit = this.compiler.exe;
this.tscSharedLib = this.compilerProps<string>(`compiler.${this.compiler.id}.sharedlibs`);
+ this.tscNewOutput = Semver.gt(asSafeVer(this.compiler.semver || '0.0.0'), '0.0.32', true);
}
override getSharedLibraryPathsAsArguments() {
@@ -102,7 +107,10 @@ export class TypeScriptNativeCompiler extends BaseCompiler {
override async generateIR(inputFilename: string, options: string[], filters: ParseFiltersAndOutputOptions) {
// These options make Clang produce an IR
- const newOptions = ['--emit=llvm', inputFilename];
+ let newOptions = ['--emit=llvm', inputFilename];
+ if (this.tscNewOutput) {
+ newOptions = ['--emit=llvm', '-o=-', inputFilename];
+ }
if (!this.tscSharedLib) {
newOptions.push('-nogc');
@@ -126,7 +134,7 @@ export class TypeScriptNativeCompiler extends BaseCompiler {
filters.libraryCode = true;
filters.directives = true;
- const ir = await this.llvmIr.process(output.stderr, filters);
+ const ir = await this.llvmIr.process(this.tscNewOutput ? output.stdout : output.stderr, filters);
return ir.asm;
}