diff options
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/hlsl.ts | 8 | ||||
-rw-r--r-- | lib/compilers/ispc.ts | 3 | ||||
-rw-r--r-- | lib/compilers/pony.ts | 7 | ||||
-rw-r--r-- | lib/compilers/spirv.ts | 13 | ||||
-rw-r--r-- | lib/compilers/tinyc.ts | 2 | ||||
-rw-r--r-- | lib/compilers/win32.ts | 2 | ||||
-rw-r--r-- | lib/compilers/zig.ts | 2 |
7 files changed, 15 insertions, 22 deletions
diff --git a/lib/compilers/hlsl.ts b/lib/compilers/hlsl.ts index c4b8f727a..0b04edfa9 100644 --- a/lib/compilers/hlsl.ts +++ b/lib/compilers/hlsl.ts @@ -22,8 +22,6 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -import _ from 'underscore'; - import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; import {BaseCompiler} from '../base-compiler.js'; import {SPIRVAsmParser} from '../parsers/asm-parser-spirv.js'; @@ -50,9 +48,9 @@ export class HLSLCompiler extends BaseCompiler { override async generateAST(inputFilename, options): Promise<ResultLine[]> { // These options make DXC produce an AST dump - const newOptions = _.filter(options, option => option !== '-Zi' && option !== '-Qembed_debug').concat([ - '-ast-dump', - ]); + const newOptions = options + .filter(option => option !== '-Zi' && option !== '-Qembed_debug') + .concat(['-ast-dump']); const execOptions = this.getDefaultExecOptions(); // A higher max output is needed for when the user includes headers diff --git a/lib/compilers/ispc.ts b/lib/compilers/ispc.ts index a75217961..87beba6c5 100644 --- a/lib/compilers/ispc.ts +++ b/lib/compilers/ispc.ts @@ -23,7 +23,6 @@ // POSSIBILITY OF SUCH DAMAGE. import Semver from 'semver'; -import _ from 'underscore'; import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; @@ -80,7 +79,7 @@ export class ISPCCompiler extends BaseCompiler { override async generateAST(inputFilename, options): Promise<ResultLine[]> { // These options make Clang produce an AST dump - const newOptions = _.filter(options, option => option !== '--colored-output').concat(['--ast-dump']); + const newOptions = options.filter(option => option !== '--colored-output').concat(['--ast-dump']); const execOptions = this.getDefaultExecOptions(); // A higher max output is needed for when the user includes headers diff --git a/lib/compilers/pony.ts b/lib/compilers/pony.ts index 5e5354212..3150eabea 100644 --- a/lib/compilers/pony.ts +++ b/lib/compilers/pony.ts @@ -24,8 +24,6 @@ import path from 'path'; -import _ from 'underscore'; - import type {CompilationResult, ExecutionOptions} from '../../types/compilation/compilation.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; import {BaseCompiler} from '../base-compiler.js'; @@ -70,7 +68,8 @@ export class PonyCompiler extends BaseCompiler { produceCfg: boolean, filters: ParseFiltersAndOutputOptions, ) { - const newOptions = _.filter(options, option => !['--pass', 'asm', '-b', this.outputFilebase].includes(option)) + const newOptions = options + .filter(option => !['--pass', 'asm', '-b', this.outputFilebase].includes(option)) .concat(unwrap(this.compiler.irArg)) .concat(['-b', path.parse(inputFilename).name]); @@ -106,7 +105,7 @@ export class PonyCompiler extends BaseCompiler { // Pony operates upon the directory as a whole, not files it seems // So we must set the input to the directory rather than a file. - options = _.map(options, arg => (arg.includes(inputFilename) ? path.dirname(arg) : arg)); + options = options.map(arg => (arg.includes(inputFilename) ? path.dirname(arg) : arg)); const compilerExecResult = await this.exec(compiler, options, execOptions); return this.transformToCompilationResult(compilerExecResult, inputFilename); diff --git a/lib/compilers/spirv.ts b/lib/compilers/spirv.ts index ba28749b4..f0e9a8867 100644 --- a/lib/compilers/spirv.ts +++ b/lib/compilers/spirv.ts @@ -24,8 +24,6 @@ import path from 'path'; -import _ from 'underscore'; - import type {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js'; import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; @@ -68,10 +66,9 @@ export class SPIRVCompiler extends BaseCompiler { backendOptions = backendOptions || {}; if (this.compiler.options) { - const compilerOptions = _.filter( - utils.splitArguments(this.compiler.options), - option => option !== '-fno-crash-diagnostics', - ); + const compilerOptions = utils + .splitArguments(this.compiler.options) + .filter(option => option !== '-fno-crash-diagnostics'); options = options.concat(compilerOptions); } @@ -193,7 +190,7 @@ export class SPIRVCompiler extends BaseCompiler { } override async generateAST(inputFilename, options): Promise<ResultLine[]> { - const newOptions = _.filter(options, option => option !== '-fcolor-diagnostics').concat(['-ast-dump']); + const newOptions = options.filter(option => option !== '-fcolor-diagnostics').concat(['-ast-dump']); const execOptions = this.getDefaultExecOptions(); execOptions.maxOutput = 1024 * 1024 * 1024; @@ -210,7 +207,7 @@ export class SPIRVCompiler extends BaseCompiler { produceCfg: boolean, filters: ParseFiltersAndOutputOptions, ) { - const newOptions = _.filter(options, option => option !== '-fcolor-diagnostics').concat('-emit-llvm'); + const newOptions = options.filter(option => option !== '-fcolor-diagnostics').concat('-emit-llvm'); const execOptions = this.getDefaultExecOptions(); execOptions.maxOutput = 1024 * 1024 * 1024; diff --git a/lib/compilers/tinyc.ts b/lib/compilers/tinyc.ts index 73ee8817b..7972f4805 100644 --- a/lib/compilers/tinyc.ts +++ b/lib/compilers/tinyc.ts @@ -45,6 +45,6 @@ export class TinyCCompiler extends BaseCompiler { } override filterUserOptions(userOptions) { - return _.filter(userOptions, opt => opt !== '-run'); + return userOptions.filter(opt => opt !== '-run'); } } diff --git a/lib/compilers/win32.ts b/lib/compilers/win32.ts index 8f2cff314..0bb8c07e2 100644 --- a/lib/compilers/win32.ts +++ b/lib/compilers/win32.ts @@ -91,7 +91,7 @@ export class Win32Compiler extends BaseCompiler { } override getStaticLibraryLinks(libraries) { - return _.map(super.getSortedStaticLibraries(libraries), lib => { + return super.getSortedStaticLibraries(libraries).map(lib => { return '"' + lib + '.lib"'; }); } diff --git a/lib/compilers/zig.ts b/lib/compilers/zig.ts index b0d55432b..e01808e57 100644 --- a/lib/compilers/zig.ts +++ b/lib/compilers/zig.ts @@ -175,7 +175,7 @@ export class ZigCompiler extends BaseCompiler { override filterUserOptions(userOptions: string[]): string[] { const forbiddenOptions = /^(((--(cache-dir|name|output|verbose))|(-(mllvm|f(no-)?emit-))).*)$/; - return _.filter(userOptions, option => !forbiddenOptions.test(option)); + return userOptions.filter(option => !forbiddenOptions.test(option)); } override isCfgCompiler(/*compilerVersion*/): boolean { |