Skip to content

Commit

Permalink
Mark Assembly compilers cfg-able (#4461)
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenRBS authored and mattgodbolt committed Jan 24, 2023
1 parent 2420f26 commit 79e4435
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/base-compiler.ts
Expand Up @@ -2387,7 +2387,7 @@ export class BaseCompiler implements ICompiler {
return output;
}

couldSupportASTDump(version) {
couldSupportASTDump(version: string) {
const versionRegex = /version (\d+.\d+)/;
const versionMatch = versionRegex.exec(version);

Expand All @@ -2399,7 +2399,7 @@ export class BaseCompiler implements ICompiler {
return false;
}

isCfgCompiler(compilerVersion) {
isCfgCompiler(compilerVersion: string) {
return compilerVersion.includes('clang') || compilerVersion.match(/^([\w-]*-)?g((\+\+)|(cc)|(dc))/g) !== null;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/compilers/assembly.ts
Expand Up @@ -185,4 +185,8 @@ export class AssemblyCompiler extends BaseCompiler {
override getObjdumpOutputFilename(defaultOutputFilename) {
return this.getGeneratedOutputFilename(defaultOutputFilename);
}

override isCfgCompiler(/* compilerVersion */) {
return true;
}
}
4 changes: 4 additions & 0 deletions lib/compilers/beebasm.ts
Expand Up @@ -101,4 +101,8 @@ export class BeebAsmCompiler extends BaseCompiler {

return result;
}

override isCfgCompiler(/*compilerVersion: string*/): boolean {
return true;
}
}

0 comments on commit 79e4435

Please sign in to comment.