mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 06:59:45 -06:00
Merge remote-tracking branch 'origin/main' into cc65nes
This commit is contained in:
@@ -122,24 +122,31 @@ group.cuclang.objdumper=/opt/compiler-explorer/cuda/11.3.1/bin/nvdisasm
|
||||
# old. It can be overriden by the user via --no-offload-arch=none
|
||||
# --offload-arch=sm_XY.
|
||||
compiler.cuclang700.exe=/opt/compiler-explorer/clang-7.0.0/bin/clang++
|
||||
compiler.cuclang700.semver=7.0.0 sm_70 CUDA-9.1
|
||||
compiler.cuclang700.semver=7.0.0
|
||||
compiler.cuclang700.name=clang 7.0.0 sm_70 CUDA-9.1
|
||||
compiler.cuclang700.options=--gcc-toolchain=/opt/compiler-explorer/gcc-8.2.0 --cuda-path=/opt/compiler-explorer/cuda/9.1.85 --cuda-gpu-arch=sm_70 --cuda-device-only
|
||||
compiler.cuclang800.exe=/opt/compiler-explorer/clang-8.0.0/bin/clang++
|
||||
compiler.cuclang800.semver=8.0.0 sm_75 CUDA-10.0
|
||||
compiler.cuclang800.semver=8.0.0
|
||||
compiler.cuclang800.name=clang 8.0.0 sm_75 CUDA-10.0
|
||||
compiler.cuclang800.options=--gcc-toolchain=/opt/compiler-explorer/gcc-8.3.0 --cuda-path=/opt/compiler-explorer/cuda/10.0.130 --cuda-gpu-arch=sm_75 --cuda-device-only
|
||||
compiler.cuclang900.exe=/opt/compiler-explorer/clang-9.0.0/bin/clang++
|
||||
compiler.cuclang900.semver=9.0.0 sm_75 CUDA-10.1
|
||||
compiler.cuclang900.semver=9.0.0
|
||||
compiler.cuclang900.name=clang 9.0.0 sm_75 CUDA-10.1
|
||||
compiler.cuclang900.options=--gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 --cuda-path=/opt/compiler-explorer/cuda/10.1.168 --cuda-gpu-arch=sm_75 --cuda-device-only
|
||||
compiler.cuclang1000.exe=/opt/compiler-explorer/clang-10.0.0/bin/clang++
|
||||
compiler.cuclang1000.semver=10.0.0 sm_75 CUDA-10.2
|
||||
compiler.cuclang1000.semver=10.0.0
|
||||
compiler.cuclang1000.name=10.0.0 sm_75 CUDA-10.2
|
||||
compiler.cuclang1000.options=--gcc-toolchain=/opt/compiler-explorer/gcc-9.3.0 --cuda-path=/opt/compiler-explorer/cuda/10.2.89 --cuda-gpu-arch=sm_75 --cuda-device-only
|
||||
compiler.cuclang1001.exe=/opt/compiler-explorer/clang-10.0.1/bin/clang++
|
||||
compiler.cuclang1001.semver=10.0.1 sm_75 CUDA-10.2
|
||||
compiler.cuclang1001.semver=10.0.1
|
||||
compiler.cuclang1001.name=10.0.1 sm_75 CUDA-10.2
|
||||
compiler.cuclang1001.options=--gcc-toolchain=/opt/compiler-explorer/gcc-9.3.0 --cuda-path=/opt/compiler-explorer/cuda/10.2.89 --cuda-gpu-arch=sm_75 --cuda-device-only
|
||||
compiler.cuclang1100.exe=/opt/compiler-explorer/clang-11.0.0/bin/clang++
|
||||
compiler.cuclang1100.semver=11.0.0 sm_75 CUDA-10.2
|
||||
compiler.cuclang1100.semver=11.0.0
|
||||
compiler.cuclang1100.name=11.0.0 sm_75 CUDA-10.2
|
||||
compiler.cuclang1100.options=--gcc-toolchain=/opt/compiler-explorer/gcc-10.2.0 --cuda-path=/opt/compiler-explorer/cuda/10.2.89 --cuda-gpu-arch=sm_75 --cuda-device-only
|
||||
compiler.cltrunk.semver=trunk sm_86 CUDA-11.3
|
||||
compiler.cltrunk.semver=trunk
|
||||
compiler.cltrunk.name=trunk sm_86 CUDA-11.3
|
||||
compiler.cltrunk.exe=/opt/compiler-explorer/clang-trunk/bin/clang++
|
||||
compiler.cltrunk.demangler=/opt/compiler-explorer/gcc-snapshot/bin/c++filt
|
||||
compiler.cltrunk.options=--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot --cuda-path=/opt/compiler-explorer/cuda/11.3.1 --cuda-gpu-arch=sm_86 --cuda-device-only -Wno-unknown-cuda-version
|
||||
@@ -158,19 +165,23 @@ compiler.hiptrunk.hidden=true
|
||||
# the clang-hip compiler type adds --gpu-bundle-output which didn't exist in ROCm 4.5
|
||||
compiler.hipclang-rocm-40502.compilerType=clang
|
||||
compiler.hipclang-rocm-40502.exe=/opt/compiler-explorer/clang-rocm-4.5.2/bin/clang++
|
||||
compiler.hipclang-rocm-40502.semver=rocm-4.5.2
|
||||
compiler.hipclang-rocm-40502.semver=4.5.2
|
||||
compiler.hipclang-rocm-40502.name=clang rocm-4.5.2
|
||||
compiler.hipclang-rocm-40502.objdumper=/opt/compiler-explorer/clang-rocm-40502/bin/llvm-objdump
|
||||
compiler.hipclang-rocm-40502.options=-x hip --cuda-device-only -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -O3 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 --rocm-path=/opt/compiler-explorer/libs/rocm/4.5.2 --rocm-device-lib-path=/opt/compiler-explorer/clang-rocm-4.5.2/amdgcn/bitcode -include hip/hip_runtime.h
|
||||
compiler.hipclang-rocm-50002.exe=/opt/compiler-explorer/clang-rocm-5.0.2/bin/clang++
|
||||
compiler.hipclang-rocm-50002.semver=rocm-5.0.2
|
||||
compiler.hipclang-rocm-50002.semver=5.0.2
|
||||
compiler.hipclang-rocm-50002.name=clang rocm-5.0.2
|
||||
compiler.hipclang-rocm-50002.objdumper=/opt/compiler-explorer/clang-rocm-50002/bin/llvm-objdump
|
||||
compiler.hipclang-rocm-50002.options=-x hip --cuda-device-only -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -O3 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -isystem /opt/compiler-explorer/libs/rocm/5.0.2/include --rocm-path=/opt/compiler-explorer/libs/rocm/5.0.2 --rocm-device-lib-path=/opt/compiler-explorer/clang-rocm-5.0.2/amdgcn/bitcode -include hip/hip_runtime.h
|
||||
compiler.hipclang-rocm-50103.exe=/opt/compiler-explorer/clang-rocm-5.1.3/bin/clang++
|
||||
compiler.hipclang-rocm-50103.semver=rocm-5.1.3
|
||||
compiler.hipclang-rocm-50103.semver=5.1.3
|
||||
compiler.hipclang-rocm-50103.name=clang rocm-5.1.3
|
||||
compiler.hipclang-rocm-50103.objdumper=/opt/compiler-explorer/clang-rocm-50103/bin/llvm-objdump
|
||||
compiler.hipclang-rocm-50103.options=-x hip --cuda-device-only -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -O3 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -isystem /opt/compiler-explorer/libs/rocm/5.1.3/include --rocm-path=/opt/compiler-explorer/libs/rocm/5.1.3 --rocm-device-lib-path=/opt/compiler-explorer/clang-rocm-5.1.3/amdgcn/bitcode -include hip/hip_runtime.h
|
||||
compiler.hipclang-rocm-50203.exe=/opt/compiler-explorer/clang-rocm-5.2.3/bin/clang++
|
||||
compiler.hipclang-rocm-50203.semver=rocm-5.2.3
|
||||
compiler.hipclang-rocm-50203.semver=5.2.3
|
||||
compiler.hipclang-rocm-50203.name=clang rocm-5.2.3
|
||||
compiler.hipclang-rocm-50203.objdumper=/opt/compiler-explorer/clang-rocm-50203/bin/llvm-objdump
|
||||
compiler.hipclang-rocm-50203.options=-x hip --cuda-device-only -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false -O3 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -isystem /opt/compiler-explorer/libs/rocm/5.2.3/include --rocm-path=/opt/compiler-explorer/libs/rocm/5.2.3 --rocm-device-lib-path=/opt/compiler-explorer/clang-rocm-5.2.3/amdgcn/bitcode -include hip/hip_runtime.h
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ levels:
|
||||
sideBySide: true
|
||||
statsId: intel
|
||||
- name: Backtrace
|
||||
description: We compress error debugging time by automating capture and providing essential context and insight about impact, all on one platform. Get started for free.
|
||||
description: Deliver uninterrupted experiences by automating your response to player-impacting errors. Get started for free.
|
||||
icon: https://static.ce-cdn.net/bt/Black-BT-Logo-A.svg
|
||||
icon_dark: https://static.ce-cdn.net/bt/White-BT-Logo-A.svg
|
||||
img: https://static.ce-cdn.net/bt/BT-logo (1).png
|
||||
url: https://hubs.la/Q013D7rx0
|
||||
url: https://backtrace.io/sign-up?utm_source=website&utm_medium=paiddisplay&utm_campaign=00O8Y000008JiuiUAC&utm_content=godboltbannerad
|
||||
priority: 500
|
||||
topIcon: true
|
||||
sideBySide: true
|
||||
|
||||
+10
-2
@@ -27,6 +27,7 @@ import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import _ from 'underscore';
|
||||
|
||||
import {CompilationResult} from '../../types/compilation/compilation.interfaces';
|
||||
import {ParseFilters} from '../../types/features/filters.interfaces';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
import {CC65AsmParser} from '../parsers/asm-parser-cc65';
|
||||
@@ -91,7 +92,14 @@ export class Cc65Compiler extends BaseCompiler {
|
||||
return env;
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number, intelAsm, demangle, filters: ParseFilters) {
|
||||
override async objdump(
|
||||
outputFilename,
|
||||
result: CompilationResult,
|
||||
maxSize: number,
|
||||
intelAsm,
|
||||
demangle,
|
||||
filters: ParseFilters,
|
||||
) {
|
||||
const res = await super.objdump(outputFilename, result, maxSize, intelAsm, demangle, filters);
|
||||
|
||||
const dirPath = path.dirname(outputFilename);
|
||||
@@ -105,7 +113,7 @@ export class Cc65Compiler extends BaseCompiler {
|
||||
return res;
|
||||
}
|
||||
|
||||
override async doBuildstepAndAddToResult(result, name, command, args, execParams) {
|
||||
override async doBuildstepAndAddToResult(result: CompilationResult, name, command, args, execParams) {
|
||||
const stepResult = await super.doBuildstepAndAddToResult(result, name, command, args, execParams);
|
||||
if (name === 'make') {
|
||||
const mapFile = path.join(execParams.customCwd, '../map.txt');
|
||||
|
||||
@@ -453,16 +453,6 @@ export class LlvmPassDumpParser {
|
||||
}
|
||||
}
|
||||
|
||||
// findLastIndex is currently unavailable in node, replacement essentially taken from
|
||||
// https://stackoverflow.com/a/53187807/89706
|
||||
findLastIndex<T>(array: Array<T>, predicate: (value: T) => boolean): number {
|
||||
let l = array.length;
|
||||
while (l--) {
|
||||
if (predicate(array[l])) return l;
|
||||
}
|
||||
return 0; // if not found slice entire array. -1 would slice only the *last* element
|
||||
}
|
||||
|
||||
applyIrFilters(ir: ResultLine[], llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) {
|
||||
// Additional filters conditionally enabled by `filterDebugInfo`
|
||||
let filters = this.filters;
|
||||
@@ -472,35 +462,36 @@ export class LlvmPassDumpParser {
|
||||
lineFilters = lineFilters.concat(this.debugInfoLineFilters);
|
||||
}
|
||||
|
||||
// Filter junk
|
||||
// prettier-ignore
|
||||
const idxAfterHeaders = this.findLastIndex(
|
||||
ir,
|
||||
line => (line.text.match(this.irDumpHeader) || line.text.match(this.machineCodeDumpHeader)) !== null);
|
||||
|
||||
return ir
|
||||
.slice(idxAfterHeaders)
|
||||
.filter(line => filters.every(re => line.text.match(re) === null)) // apply filters
|
||||
.map(_line => {
|
||||
let line = _line.text;
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
let newLine = line;
|
||||
for (const re of lineFilters) {
|
||||
newLine = newLine.replace(re, '');
|
||||
return (
|
||||
ir
|
||||
// whole-line filters
|
||||
.filter(line => filters.every(re => line.text.match(re) === null))
|
||||
// intra-line filters
|
||||
.map(_line => {
|
||||
let line = _line.text;
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
let newLine = line;
|
||||
for (const re of lineFilters) {
|
||||
newLine = newLine.replace(re, '');
|
||||
}
|
||||
if (newLine === line) {
|
||||
break;
|
||||
} else {
|
||||
line = newLine;
|
||||
}
|
||||
}
|
||||
if (newLine === line) {
|
||||
break;
|
||||
} else {
|
||||
line = newLine;
|
||||
}
|
||||
}
|
||||
_line.text = line;
|
||||
return _line;
|
||||
});
|
||||
_line.text = line;
|
||||
return _line;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
process(ir: ResultLine[], _: ParseFilters, llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) {
|
||||
process(output: ResultLine[], _: ParseFilters, llvmOptPipelineOptions: LLVMOptPipelineBackendOptions) {
|
||||
// Crop out any junk before the pass dumps (e.g. warnings)
|
||||
const ir = output.slice(
|
||||
output.findIndex(line => line.text.match(this.irDumpHeader) || line.text.match(this.machineCodeDumpHeader)),
|
||||
);
|
||||
const preprocessed_lines = this.applyIrFilters(ir, llvmOptPipelineOptions);
|
||||
return this.breakdownOutput(preprocessed_lines, llvmOptPipelineOptions);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2022, Compiler Explorer Authors
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
export enum CompilationStatusCode {
|
||||
NONE = 0,
|
||||
OK = 1,
|
||||
WITH_WARNINGS = 2,
|
||||
WITH_ERRORS = 3,
|
||||
COMPILING = 4,
|
||||
}
|
||||
|
||||
export interface CompilationStatus {
|
||||
code: CompilationStatusCode;
|
||||
compilerOut: number;
|
||||
}
|
||||
@@ -36,18 +36,14 @@ import jqXHR = JQuery.jqXHR;
|
||||
import ErrorTextStatus = JQuery.Ajax.ErrorTextStatus;
|
||||
import {CompilerInfo} from '../types/compiler.interfaces';
|
||||
import {CompilationResult} from '../types/compilation/compilation.interfaces';
|
||||
|
||||
type CompilationStatus = {
|
||||
code: 0 | 1 | 2 | 3 | 4;
|
||||
compilerOut: number;
|
||||
};
|
||||
import {CompilationStatus} from './compiler-service.interfaces';
|
||||
|
||||
const ASCII_COLORS_RE = new RegExp(/\x1B\[[\d;]*m(.\[K)?/g);
|
||||
|
||||
export class CompilerService {
|
||||
private readonly base = window.httpRoot;
|
||||
private allowStoreCodeDebug: boolean;
|
||||
private cache: LRU;
|
||||
cache: LRU;
|
||||
private readonly compilersByLang: Record<string, Record<string, CompilerInfo>>;
|
||||
|
||||
constructor(eventHub: EventEmitter) {
|
||||
@@ -148,7 +144,7 @@ export class CompilerService {
|
||||
.value();
|
||||
}
|
||||
|
||||
private getCompilersForLang(langId: string): Record<string, CompilerInfo> {
|
||||
getCompilersForLang(langId: string): Record<string, CompilerInfo> {
|
||||
return langId in this.compilersByLang ? this.compilersByLang[langId] : {};
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
import {editor} from 'monaco-editor/';
|
||||
|
||||
type Decoration = {
|
||||
export type Decoration = {
|
||||
decoration: editor.IModelDecorationOptions;
|
||||
filter: string[];
|
||||
name: string;
|
||||
|
||||
@@ -237,7 +237,7 @@ export class MultifileService {
|
||||
|
||||
if (file.isOpen) {
|
||||
const editor = this.hub.getEditorById(file.editorId);
|
||||
return editor.getSource();
|
||||
return editor?.getSource() ?? '';
|
||||
} else {
|
||||
return file.content;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2022, Compiler Explorer Authors
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {WidgetState} from '../widgets/libs-widget.interfaces';
|
||||
|
||||
export type CompilerState = WidgetState & {
|
||||
tree?: number;
|
||||
source?: number;
|
||||
compiler: string;
|
||||
options?: string;
|
||||
flagsViewOpen?: boolean;
|
||||
wantOptInfo?: boolean;
|
||||
lang?: string;
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) 2022, Compiler Explorer Authors
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
export type EditorState = {
|
||||
filename?: string;
|
||||
options?: {
|
||||
readOnly?: boolean;
|
||||
};
|
||||
source?: string;
|
||||
lang?: string;
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -291,8 +291,8 @@ export class Tree {
|
||||
if (file) {
|
||||
file.isOpen = false;
|
||||
const editor = this.hub.getEditorById(editorId);
|
||||
file.langId = editor.currentLanguage.id;
|
||||
file.content = editor.getSource();
|
||||
file.langId = editor?.currentLanguage?.id ?? '';
|
||||
file.content = editor?.getSource() ?? '';
|
||||
file.editorId = -1;
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ export class Tree {
|
||||
(file.isIncluded ? this.namedItems : this.unnamedItems).append(item);
|
||||
}
|
||||
|
||||
private refresh() {
|
||||
refresh() {
|
||||
this.updateState();
|
||||
|
||||
this.namedItems.html('');
|
||||
@@ -399,7 +399,7 @@ export class Tree {
|
||||
this.hub.addInEditorStackIfPossible(dragConfig);
|
||||
} else {
|
||||
const editor = this.hub.getEditorById(file.editorId);
|
||||
this.hub.activateTabForContainer(editor.container);
|
||||
this.hub.activateTabForContainer(editor?.container);
|
||||
}
|
||||
|
||||
this.sendChangesToAllEditors();
|
||||
|
||||
@@ -624,6 +624,10 @@ div.populararguments div.dropdown-menu {
|
||||
overflow: auto; /* move scrollbar into sponsor part - keep quickaccess buttons on screen */
|
||||
}
|
||||
|
||||
#ces-banner-text {
|
||||
margin-right: .1em;
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
.ces-content-root {
|
||||
font-size: 60%;
|
||||
@@ -714,7 +718,7 @@ div.populararguments div.dropdown-menu {
|
||||
}
|
||||
|
||||
.ces-icon {
|
||||
margin-left: 0.3em;
|
||||
padding: 0 0.2em 0 0.2em;
|
||||
height: 1.5em;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,13 +257,13 @@ export class LoadSave {
|
||||
}
|
||||
}
|
||||
|
||||
private setMinimalOptions(editorText: string, currentLanguage: Language) {
|
||||
setMinimalOptions(editorText: string, currentLanguage: Language) {
|
||||
this.editorText = editorText;
|
||||
this.currentLanguage = currentLanguage;
|
||||
this.extension = currentLanguage.extensions[0] || '.txt';
|
||||
}
|
||||
|
||||
private onSaveToFile(fileEditor?: string) {
|
||||
onSaveToFile(fileEditor?: string) {
|
||||
try {
|
||||
const fileLang = this.currentLanguage?.name ?? '';
|
||||
const name = fileLang && fileEditor !== undefined ? fileLang + ' Editor #' + fileEditor + ' ' : '';
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {LlvmIrParser} from '../lib/llvm-ir';
|
||||
import {LlvmPassDumpParser} from '../lib/parsers/llvm-pass-dump-parser';
|
||||
import * as properties from '../lib/properties';
|
||||
|
||||
import {chai} from './utils';
|
||||
@@ -266,62 +265,3 @@ describe('llvm-ir isLineLlvmDirective', function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('llvm-pass-dump filter', function () {
|
||||
let llvmPassDumpParser;
|
||||
|
||||
before(() => {
|
||||
let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
|
||||
let compilerProps = fakeProps.get.bind(fakeProps, 'c++');
|
||||
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
|
||||
});
|
||||
// prettier-ignore
|
||||
const rawFuncIR = [
|
||||
{text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
|
||||
{text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) #0 !dbg !7 {'},
|
||||
{text: 'entry:'},
|
||||
{text: ' %s1.addr = alloca %struct.S1*, align 8'},
|
||||
{text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression()), !dbg !36'},
|
||||
{text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression()), !dbg !32'},
|
||||
{text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7'},
|
||||
{text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !dbg !38, !tbaa !32'},
|
||||
{text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0, !dbg !39'},
|
||||
{text: ' %1 = load i64, i64* %t, align 8, !dbg !40, !tbaa !41'},
|
||||
{text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !dbg !46, !tbaa !32'},
|
||||
{text: ' store i64 %1, i64* %t2, align 8, !dbg !49, !tbaa !50'},
|
||||
{text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0, !dbg !54'},
|
||||
{text: ' ret void, !dbg !61'},
|
||||
];
|
||||
|
||||
it('should not filter out dbg metadata', function () {
|
||||
const options = {filterDebugInfo: false};
|
||||
// prettier-ignore
|
||||
llvmPassDumpParser
|
||||
.applyIrFilters(rawFuncIR, options)
|
||||
.should.deep.equal(rawFuncIR);
|
||||
});
|
||||
|
||||
it('should filter out dbg metadata too', function () {
|
||||
const options = {filterDebugInfo: true};
|
||||
// prettier-ignore
|
||||
llvmPassDumpParser
|
||||
.applyIrFilters(rawFuncIR, options)
|
||||
.should.deep.equal([
|
||||
{text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
|
||||
{text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {'},
|
||||
{text: 'entry:'},
|
||||
{text: ' %s1.addr = alloca %struct.S1*, align 8'},
|
||||
{text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0'},
|
||||
{text: ' %1 = load i64, i64* %t, align 8, !tbaa !41'},
|
||||
{text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' store i64 %1, i64* %t2, align 8, !tbaa !50'},
|
||||
{text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0'},
|
||||
{text: ' ret void'},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import * as properties from '../lib/properties';
|
||||
|
||||
import {LlvmPassDumpParser} from '../lib/parsers/llvm-pass-dump-parser';
|
||||
|
||||
const languages = {
|
||||
'c++': {id: 'c++'},
|
||||
};
|
||||
|
||||
function deepCopy(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
describe('llvm-pass-dump-parser filter', function () {
|
||||
let llvmPassDumpParser;
|
||||
|
||||
before(() => {
|
||||
let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
|
||||
let compilerProps = fakeProps.get.bind(fakeProps, 'c++');
|
||||
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
|
||||
});
|
||||
// prettier-ignore
|
||||
const rawFuncIR = [
|
||||
{text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
|
||||
{text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) #0 !dbg !7 {'},
|
||||
{text: 'entry:'},
|
||||
{text: ' %s1.addr = alloca %struct.S1*, align 8'},
|
||||
{text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression()), !dbg !36'},
|
||||
{text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression()), !dbg !32'},
|
||||
{text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7'},
|
||||
{text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !dbg !38, !tbaa !32'},
|
||||
{text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0, !dbg !39'},
|
||||
{text: ' %1 = load i64, i64* %t, align 8, !dbg !40, !tbaa !41'},
|
||||
{text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !dbg !46, !tbaa !32'},
|
||||
{text: ' store i64 %1, i64* %t2, align 8, !dbg !49, !tbaa !50'},
|
||||
{text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0, !dbg !54'},
|
||||
{text: ' ret void, !dbg !61'},
|
||||
];
|
||||
|
||||
it('should not filter out dbg metadata', function () {
|
||||
const options = {filterDebugInfo: false};
|
||||
// prettier-ignore
|
||||
llvmPassDumpParser
|
||||
.applyIrFilters(deepCopy(rawFuncIR), options)
|
||||
.should.deep.equal(rawFuncIR);
|
||||
});
|
||||
|
||||
it('should filter out dbg metadata too', function () {
|
||||
const options = {filterDebugInfo: true};
|
||||
// prettier-ignore
|
||||
llvmPassDumpParser
|
||||
.applyIrFilters(deepCopy(rawFuncIR), options)
|
||||
.should.deep.equal([
|
||||
{text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
|
||||
{text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {'},
|
||||
{text: 'entry:'},
|
||||
{text: ' %s1.addr = alloca %struct.S1*, align 8'},
|
||||
{text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !tbaa !32'},
|
||||
{text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0'},
|
||||
{text: ' %1 = load i64, i64* %t, align 8, !tbaa !41'},
|
||||
{text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !tbaa !32'},
|
||||
{text: ' store i64 %1, i64* %t2, align 8, !tbaa !50'},
|
||||
{text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0'},
|
||||
{text: ' ret void'},
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -86,7 +86,12 @@ export type CompilationResult = {
|
||||
haskellCmmOutput?: any;
|
||||
|
||||
forceBinaryView?: boolean;
|
||||
|
||||
bbcdiskimage?: string;
|
||||
speccytape?: string;
|
||||
miraclesms?: string;
|
||||
jsnesrom?: string;
|
||||
|
||||
hints?: string[];
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ block prepend content
|
||||
button.close(type="button" aria-hidden="true") ×
|
||||
ul.navbar-nav.navbar-right
|
||||
if showSponsors
|
||||
li.nav-item.btn.btn-outline-primary#ces(data-toggle="modal")
|
||||
li.nav-item.btn.btn-outline-info#ces(data-toggle="modal")
|
||||
span#ces-banner-text Sponsors
|
||||
include sponsor-icons.pug
|
||||
li.nav-item.dropdown
|
||||
|
||||
Reference in New Issue
Block a user