diff options
author | Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> | 2023-06-11 17:00:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-11 17:00:53 -0400 |
commit | 10851a1ddaea3e1111ea9f50afba1ff993a0967b (patch) | |
tree | 9792df118f580afb5988a607ce048244455be2c5 /lib/compilers/clangcl.ts | |
parent | 79bba4c1d1031fa250919539e7681cfcba250b7a (diff) | |
download | compiler-explorer-10851a1ddaea3e1111ea9f50afba1ff993a0967b.tar.gz compiler-explorer-10851a1ddaea3e1111ea9f50afba1ff993a0967b.zip |
LLVM IR pane improvements (#5078)gh-7669
This PR will add filtering and other output options to the LLVM IR pane


Closes #5062
Related to #5045
Diffstat (limited to 'lib/compilers/clangcl.ts')
-rw-r--r-- | lib/compilers/clangcl.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/compilers/clangcl.ts b/lib/compilers/clangcl.ts index 3b182496a..25c40c41c 100644 --- a/lib/compilers/clangcl.ts +++ b/lib/compilers/clangcl.ts @@ -29,6 +29,7 @@ import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.in import {Win32Compiler} from './win32.js'; import {unwrap} from '../assert.js'; +import {LLVMIrBackendOptions} from '../../types/compilation/ir.interfaces.js'; export class ClangCLCompiler extends Win32Compiler { static override get key() { @@ -45,7 +46,12 @@ export class ClangCLCompiler extends Win32Compiler { this.compiler.includeFlag = '/clang:-isystem'; } - override async generateIR(inputFilename: string, options: string[], filters: ParseFiltersAndOutputOptions) { + override async generateIR( + inputFilename: string, + options: string[], + irOptions: LLVMIrBackendOptions, + filters: ParseFiltersAndOutputOptions, + ) { // These options make Clang produce an IR const newOptions = options .filter(option => option !== '/FA' && !option.startsWith('/Fa')) @@ -59,11 +65,11 @@ export class ClangCLCompiler extends Win32Compiler { if (output.code !== 0) { return [{text: 'Failed to run compiler to get IR code'}]; } - const ir = await this.processIrOutput(output, filters); + const ir = await this.processIrOutput(output, irOptions, filters); return ir.asm; } - override getIrOutputFilename(inputFilename: string, filters: ParseFiltersAndOutputOptions): string { + override getIrOutputFilename(inputFilename: string): string { return this.filename(path.dirname(inputFilename) + '/output.s.obj'); } |