@@ -83,6 +83,9 @@ export enum ActionType {
8383 CompileLlvmIrRequest = 'COMPILE_LLVM_IR_REQUEST' ,
8484 CompileLlvmIrSucceeded = 'COMPILE_LLVM_IR_SUCCEEDED' ,
8585 CompileLlvmIrFailed = 'COMPILE_LLVM_IR_FAILED' ,
86+ CompileHirRequest = 'COMPILE_HIR_REQUEST' ,
87+ CompileHirSucceeded = 'COMPILE_HIR_SUCCEEDED' ,
88+ CompileHirFailed = 'COMPILE_HIR_FAILED' ,
8689 CompileMirRequest = 'COMPILE_MIR_REQUEST' ,
8790 CompileMirSucceeded = 'COMPILE_MIR_SUCCEEDED' ,
8891 CompileMirFailed = 'COMPILE_MIR_FAILED' ,
@@ -346,6 +349,27 @@ const performCompileToLLVMOnly = () =>
346349 failure : receiveCompileLlvmIrFailure ,
347350 } ) ;
348351
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 : requestCompileHir ,
364+ success : receiveCompileHirSuccess ,
365+ failure : receiveCompileHirFailure ,
366+ } ) ;
367+
368+ const performCompileToNightlyHirOnly = ( ) : ThunkAction => dispatch => {
369+ dispatch ( changeChannel ( Channel . Nightly ) ) ;
370+ dispatch ( performCompileToHirOnly ( ) ) ;
371+ } ;
372+
349373const requestCompileMir = ( ) =>
350374 createAction ( ActionType . CompileMirRequest ) ;
351375
@@ -390,6 +414,7 @@ const PRIMARY_ACTIONS: { [index in PrimaryAction]: () => ThunkAction } = {
390414 [ PrimaryActionCore . Test ] : performTestOnly ,
391415 [ PrimaryActionAuto . Auto ] : performAutoOnly ,
392416 [ PrimaryActionCore . LlvmIr ] : performCompileToLLVMOnly ,
417+ [ PrimaryActionCore . Hir ] : performCompileToHirOnly ,
393418 [ PrimaryActionCore . Mir ] : performCompileToMirOnly ,
394419 [ PrimaryActionCore . Wasm ] : performCompileToNightlyWasmOnly ,
395420} ;
@@ -417,6 +442,8 @@ export const performCompileToLLVM =
417442 performAndSwitchPrimaryAction ( performCompileToLLVMOnly , PrimaryActionCore . LlvmIr ) ;
418443export const performCompileToMir =
419444 performAndSwitchPrimaryAction ( performCompileToMirOnly , PrimaryActionCore . Mir ) ;
445+ export const performCompileToNightlyHir =
446+ performAndSwitchPrimaryAction ( performCompileToNightlyHirOnly , PrimaryActionCore . Hir ) ;
420447export const performCompileToNightlyWasm =
421448 performAndSwitchPrimaryAction ( performCompileToNightlyWasmOnly , PrimaryActionCore . Wasm ) ;
422449
0 commit comments