@@ -83,6 +83,9 @@ export enum ActionType {
83
83
CompileLlvmIrRequest = 'COMPILE_LLVM_IR_REQUEST' ,
84
84
CompileLlvmIrSucceeded = 'COMPILE_LLVM_IR_SUCCEEDED' ,
85
85
CompileLlvmIrFailed = 'COMPILE_LLVM_IR_FAILED' ,
86
+ CompileHirRequest = 'COMPILE_HIR_REQUEST' ,
87
+ CompileHirSucceeded = 'COMPILE_HIR_SUCCEEDED' ,
88
+ CompileHirFailed = 'COMPILE_HIR_FAILED' ,
86
89
CompileMirRequest = 'COMPILE_MIR_REQUEST' ,
87
90
CompileMirSucceeded = 'COMPILE_MIR_SUCCEEDED' ,
88
91
CompileMirFailed = 'COMPILE_MIR_FAILED' ,
@@ -346,6 +349,27 @@ const performCompileToLLVMOnly = () =>
346
349
failure : receiveCompileLlvmIrFailure ,
347
350
} ) ;
348
351
352
+ const requestCompileHir = ( ) =>
353
+ createAction ( ActionType . CompileHirRequest ) ;
354
+
355
+ const receiveCompileHirSuccess = ( { code, stdout, stderr } ) =>
356
+ createAction ( ActionType . CompileHirSucceeded , { code, stdout, stderr } ) ;
357
+
358
+ const receiveCompileHirFailure = ( { error } ) =>
359
+ createAction ( ActionType . CompileHirFailed , { error } ) ;
360
+
361
+ const performCompileToHirOnly = ( ) =>
362
+ performCompileShow ( 'hir' , {
363
+ request : requestCompileMir ,
364
+ success : receiveCompileMirSuccess ,
365
+ failure : receiveCompileMirFailure ,
366
+ } ) ;
367
+
368
+ const performCompileToNightlyHirOnly = ( ) : ThunkAction => dispatch => {
369
+ dispatch ( changeChannel ( Channel . Nightly ) ) ;
370
+ dispatch ( performCompileToHirOnly ( ) ) ;
371
+ } ;
372
+
349
373
const requestCompileMir = ( ) =>
350
374
createAction ( ActionType . CompileMirRequest ) ;
351
375
@@ -390,6 +414,7 @@ const PRIMARY_ACTIONS: { [index in PrimaryAction]: () => ThunkAction } = {
390
414
[ PrimaryActionCore . Test ] : performTestOnly ,
391
415
[ PrimaryActionAuto . Auto ] : performAutoOnly ,
392
416
[ PrimaryActionCore . LlvmIr ] : performCompileToLLVMOnly ,
417
+ [ PrimaryActionCore . Hir ] : performCompileToHirOnly ,
393
418
[ PrimaryActionCore . Mir ] : performCompileToMirOnly ,
394
419
[ PrimaryActionCore . Wasm ] : performCompileToNightlyWasmOnly ,
395
420
} ;
@@ -417,6 +442,8 @@ export const performCompileToLLVM =
417
442
performAndSwitchPrimaryAction ( performCompileToLLVMOnly , PrimaryActionCore . LlvmIr ) ;
418
443
export const performCompileToMir =
419
444
performAndSwitchPrimaryAction ( performCompileToMirOnly , PrimaryActionCore . Mir ) ;
445
+ export const performCompileToNightlyHir =
446
+ performAndSwitchPrimaryAction ( performCompileToNightlyHirOnly , PrimaryActionCore . Hir ) ;
420
447
export const performCompileToNightlyWasm =
421
448
performAndSwitchPrimaryAction ( performCompileToNightlyWasmOnly , PrimaryActionCore . Wasm ) ;
422
449
0 commit comments