diff options
Diffstat (limited to 'lib/compilers/clang.ts')
-rw-r--r-- | lib/compilers/clang.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/compilers/clang.ts b/lib/compilers/clang.ts index 39edf3ad9..ffb83d1c6 100644 --- a/lib/compilers/clang.ts +++ b/lib/compilers/clang.ts @@ -38,6 +38,7 @@ import type {ExecutableExecutionOptions, UnprocessedExecResult} from '../../type import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; import {ArtifactType} from '../../types/tool.interfaces.js'; import {BaseCompiler} from '../base-compiler.js'; +import {CompilationEnvironment} from '../compilation-env.js'; import {AmdgpuAsmParser} from '../parsers/asm-parser-amdgpu.js'; import {HexagonAsmParser} from '../parsers/asm-parser-hexagon.js'; import {SassAsmParser} from '../parsers/asm-parser-sass.js'; @@ -54,10 +55,10 @@ export class ClangCompiler extends BaseCompiler { return 'clang'; } - constructor(info: PreliminaryCompilerInfo, env) { - // By default use the compiler-local llvm demangler, but allow overriding from config - // (for bpf) - if (info.demangler === undefined) { + constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) { + // Prefer the demangler bundled with this clang version. + // Still allows overriding from config (for bpf) + if (!info.demangler || info.demangler.includes('llvm-cxxfilt')) { const demanglerPath = path.join(path.dirname(info.exe), 'llvm-cxxfilt'); if (fs.existsSync(demanglerPath)) { info.demangler = demanglerPath; |