Merge branch 'staging'

Conflicts:
	etc/config/c++.amazon.properties
	etc/config/c++.amazon1204.properties
	static/gcc.css
dev/git-series/gccdum
Matt Godbolt 7 years ago
commit 1ce080601b

@ -9,6 +9,7 @@
<CLASSES>
<root url="file://$PROJECT_DIR$/node_modules" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" assert-keyword="false" jdk-15="false" />
</project>

@ -1,21 +1,50 @@
compilers=gcc1204@20480:clang350:clang351:g482:g492:g510:g520:g530:ppcg48:aarchg48:armhfg482:clang37x:clang36x:clang371:clang380:g6:g62:mips5:mips5el:mips564:mips564el
compilers=gcc1204@20480:clang350:clang351:g471:g472:g473:g474:g481:g482:g483:g484:g485:g490:g491:g492:g493:g494:g510:g520:g530:g540:ppcg48:aarchg48:armhfg482:clang37x:clang36x:clang371:clang380:clang381:clang390:g6:g62:mips5:mips5el:mips564:mips564el:g7snapshot
defaultCompiler=g62
###############################
# GCC for x86
compiler.g482.exe=/usr/bin/g++-4.8
compiler.g471.exe=/opt/gcc-explorer/gcc-4.7.1/bin/g++
compiler.g471.name=x86-64 gcc 4.7.1
compiler.g472.exe=/opt/gcc-explorer/gcc-4.7.2/bin/g++
compiler.g472.name=x86-64 gcc 4.7.2
compiler.g473.exe=/opt/gcc-explorer/gcc-4.7.3/bin/g++
compiler.g473.name=x86-64 gcc 4.7.3
compiler.g473.alias=/usr/bin/g++-4.7
compiler.g474.exe=/opt/gcc-explorer/gcc-4.7.4/bin/g++
compiler.g474.name=x86-64 gcc 4.7.4
compiler.g481.exe=/opt/gcc-explorer/gcc-4.8.1/bin/g++
compiler.g481.name=x86-64 gcc 4.8.1
compiler.g482.exe=/opt/gcc-explorer/gcc-4.8.2/bin/g++
compiler.g482.name=x86-64 gcc 4.8.2
compiler.g492.exe=/usr/bin/g++-4.9
compiler.g483.exe=/opt/gcc-explorer/gcc-4.8.3/bin/g++
compiler.g483.name=x86-64 gcc 4.8.3
compiler.g484.exe=/opt/gcc-explorer/gcc-4.8.4/bin/g++
compiler.g484.name=x86-64 gcc 4.8.4
compiler.g485.exe=/opt/gcc-explorer/gcc-4.8.5/bin/g++
compiler.g485.name=x86-64 gcc 4.8.5
compiler.g490.exe=/opt/gcc-explorer/gcc-4.9.0/bin/g++
compiler.g490.name=x86-64 gcc 4.9.0
compiler.g491.exe=/opt/gcc-explorer/gcc-4.9.1/bin/g++
compiler.g491.name=x86-64 gcc 4.9.1
compiler.g492.exe=/opt/gcc-explorer/gcc-4.9.2/bin/g++
compiler.g492.name=x86-64 gcc 4.9.2
compiler.g493.exe=/opt/gcc-explorer/gcc-4.9.3/bin/g++
compiler.g493.name=x86-64 gcc 4.9.3
compiler.g494.exe=/opt/gcc-explorer/gcc-4.9.4/bin/g++
compiler.g494.name=x86-64 gcc 4.9.4
compiler.g510.exe=/opt/gcc-explorer/gcc-5.1.0/bin/g++
compiler.g510.name=x86-64 gcc 5.1
compiler.g520.exe=/opt/gcc-explorer/gcc-5.2.0/bin/g++
compiler.g520.name=x86-64 gcc 5.2
compiler.g530.exe=/opt/gcc-explorer/gcc-5.3.0/bin/g++
compiler.g530.name=x86-64 gcc 5.3
compiler.g540.exe=/opt/gcc-explorer/gcc-5.4.0/bin/g++
compiler.g540.name=x86-64 gcc 5.4
compiler.g6.exe=/opt/gcc-explorer/gcc-6.1.0/bin/g++
compiler.g6.name=x86-64 gcc 6.1
compiler.g62.exe=/opt/gcc-explorer/gcc-6.2.0/bin/g++
compiler.g62.name=x86-64 gcc 6.2
compiler.g7snapshot.exe= /opt/gcc-explorer/gcc-7-20160904/bin/g++
compiler.g7snapshot.name=x86-64 gcc 7 (snapshot)
compiler.clang350.exe=/usr/bin/clang++-3.5
compiler.clang350.name=x86-64 clang 3.5
compiler.clang350.intelAsm=-masm=intel
@ -37,6 +66,12 @@ compiler.clang371.intelAsm=-masm=intel
compiler.clang380.exe=/opt/gcc-explorer/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang380.name=x86-64 clang 3.8
compiler.clang380.intelAsm=-masm=intel
compiler.clang381.exe=/opt/gcc-explorer/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang381.name=x86-64 clang 3.8.1
compiler.clang381.intelAsm=-masm=intel
compiler.clang390.exe=/opt/gcc-explorer/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang++
compiler.clang390.name=x86-64 clang 3.9.0
compiler.clang390.intelAsm=-masm=intel
###############################
# GCC for ppc

@ -1,6 +1,6 @@
compilers=g447:g453:g464:g473:g481:g490:armg453:clang30:avrg453:armg463:icc1301:clang32:clang33:clang341:g490c1:g490c2
compilers=g447:g453:g464:armg453:clang30:avrg453:armg463:icc1301:clang32:clang33:clang341
# disabled still causes client to die: msp430g453
defaultCompiler=g490
defaultCompiler=g447
###############################
# GCC for x86
compiler.g447.exe=/usr/bin/g++-4.4
@ -12,25 +12,6 @@ compiler.g453.name=x86-64 gcc 4.5.3
compiler.g464.exe=/usr/bin/g++-4.6
compiler.g464.alias=/usr/bin/g++-4.6
compiler.g464.name=x86-64 gcc 4.6.4
compiler.g473.exe=/usr/bin/g++-4.7
compiler.g473.alias=/usr/bin/g++-4.7
compiler.g473.name=x86-64 gcc 4.7.3
compiler.g481.exe=/usr/bin/g++-4.8
compiler.g481.alias=/usr/bin/g++-4.8
compiler.g481.name=x86-64 gcc 4.8.1
compiler.g490.exe=/opt/gcc-explorer/gcc-4.9.0/bin/g++
compiler.g490.alias=/opt/gcc-4.9.0/bin/g++
compiler.g490.name=x86-64 gcc 4.9.0
compiler.g490.supportsBinary=false
# GCC (concepts branch) for x86
compiler.g490c1.exe=/opt/gcc-explorer/gcc-4.9.0-with-concepts/bin/g++
compiler.g490c1.alias=/opt/gcc-4.9.0-with-concepts/bin/g++
compiler.g490c1.name=x86-64 gcc 4.9.0 (w/concepts)
compiler.g490c1.supportsBinary=false
compiler.g490c2.exe=/opt/gcc-explorer/gcc-4.9.0-0909-concepts/bin/g++
compiler.g490c2.alias=/opt/gcc-4.9.0-0909-concepts/bin/g++
compiler.g490c2.name=x86-64 gcc 4.9.0 (w/concepts)
compiler.g490c2.supportsBinary=false
# Intel for x86
compiler.icc1301.exe=/opt/gcc-explorer/intel/bin/icc
compiler.icc1301.alias=/opt/intel/bin/icc

@ -8,7 +8,7 @@ maxConcurrentCompiles=2
staticMaxAgeMs=1000
optionsWhitelistRe=.*
optionsBlacklistRe=^(-W[alp],)?((-wrapper|-fplugin.*|-specs|-load|-plugin|(@.*)|-I|-i)(=.*)?|--)$
allowedShortUrlHostRe=^([a-z]+\.)?(xania|godbolt)\.org$
allowedShortUrlHostRe=^([-a-z.]+\.)?(xania|godbolt)\.org$
googleShortLinkRewrite=^https?://goo.gl/(.*)$|https://godbolt.org/g/$1
wdiff=wdiff

@ -23,6 +23,7 @@
// POSSIBILITY OF SUCH DAMAGE.
(function () {
var _ = require('underscore-node');
var tabsRe = /\t/g;
function expandTabs(line) {
@ -35,35 +36,91 @@
});
}
function processAsm(asm, filters) {
if (filters.binary) return processBinaryAsm(asm, filters);
var labelFind = /[.a-zA-Z_][a-zA-Z0-9$_.]*/g;
var dataDefn = /\.(string|asciz|ascii|[1248]?byte|short|word|long|quad|value|zero)/;
var fileFind = /^\s*\.file\s+(\d+)\s+"([^"]+)".*/;
var hasOpcode = /^\s*([a-zA-Z$_][a-zA-Z0-9$_.]*:\s*)?[a-zA-Z].*/;
var labelDef = /^([.a-zA-Z_][a-zA-Z0-9$_.]+):/;
var hasOpcode = /^\s*([a-zA-Z$_][a-zA-Z0-9$_.]*:\s*)?[a-zA-Z].*/;
var result = [];
var asmLines = asm.split("\n");
function findUsedLabels(asmLines, filterDirectives) {
var labelsUsed = {};
var labelFind = /[.a-zA-Z0-9_][a-zA-Z0-9$_.]*/g;
var files = {};
var prevLabel = "";
var dataDefn = /\.(string|asciz|ascii|[1248]?byte|short|word|long|quad|value|zero)/;
var fileFind = /^\s*\.file\s+(\d+)\s+"([^"]+)".*/;
var hasOpcode = /^\s*([a-zA-Z0-9$_][a-zA-Z0-9$_.]*:\s*)?[a-zA-Z].*/;
var weakUsages = {};
var currentLabel = "";
// Scan through looking for definite label usages (ones used by opcodes),
// and ones that are weakly used: that is, their use is conditional on another label.
// For example:
// .foo: .string "moo"
// .baz: .quad .foo
// mov eax, .baz
// In this case, the '.baz' is used by an opcode, and so is strongly used.
// The '.foo' is weakly used by .baz.
asmLines.forEach(function (line) {
if (line === "" || line[0] === ".") return;
var match = line.match(labelFind);
if (match && (!filters.directives || line.match(hasOpcode))) {
var match = line.match(labelDef);
if (match)
currentLabel = match[1];
if (!line || line[0] === '.') return;
match = line.match(labelFind);
if (!match) return;
if (!filterDirectives || line.match(hasOpcode)) {
// Only count a label as used if it's used by an opcode, or else we're not filtering directives.
match.forEach(function (label) {
labelsUsed[label] = true;
});
} else if (currentLabel) {
// Note any "weak" usages by this label; that is, usages that are only
// interesting if the currentLabel is used by an opcode.
if (!weakUsages[currentLabel]) weakUsages[currentLabel] = [];
match.forEach(function (label) {
weakUsages[currentLabel].push(label);
});
}
match = line.match(fileFind);
});
// Now follow the chains of used labels, marking any weak references they refer
// to as also used. We iteratively do this until either no new labels are found,
// or we hit a limit (only here to prevent a pathological case from hanging).
var MaxLabelIterations = 10;
for (var iter = 0; iter < MaxLabelIterations; ++iter) {
var toAdd = [];
_.each(labelsUsed, function (t, label) {
_.each(weakUsages[label], function (nowused) {
if (labelsUsed[nowused]) return;
toAdd.push(nowused);
});
});
if (!toAdd) break;
_.each(toAdd, function (label) {
labelsUsed[label] = true;
});
}
return labelsUsed;
}
function parseFiles(asmLines) {
var files = {};
asmLines.forEach(function (line) {
var match = line.match(fileFind);
if (match) {
files[parseInt(match[1])] = match[2];
}
});
return files;
}
function processAsm(asm, filters) {
if (filters.binary) return processBinaryAsm(asm, filters);
var result = [];
var asmLines = asm.split("\n");
var labelsUsed = findUsedLabels(asmLines, filters.directives);
var files = parseFiles(asmLines);
var prevLabel = "";
var directive = /^\s*\..*$/;
var labelDefinition = /^([a-zA-Z0-9$_.]+):/;
var commentOnly = /^\s*(#|@|\/\/).*/;
var sourceTag = /^\s*\.loc\s+(\d+)\s+(\d+).*/;
var stdInLooking = /.*<stdin>|-/;
@ -89,7 +146,7 @@
if (filters.commentOnly && line.match(commentOnly)) return;
match = line.match(labelDefinition);
match = line.match(labelDef);
if (match) {
// It's a label definition.
if (labelsUsed[match[1]] === undefined) {

@ -28,7 +28,8 @@
"nopt": "3.0.x",
"serve-favicon": "2.3.x",
"serve-static": "1.10.x",
"temp": "0.8.x"
"temp": "0.8.x",
"underscore-node": "*"
},
"devDependencies": {
"supervisor": "0.3.1"

@ -288,4 +288,9 @@ li.social {
.well-tiny {
padding: 2px;
border-radius: 2px;
}
}
.dropdown-menu.compilers {
max-height: 400px;
overflow-y: auto;
}

@ -0,0 +1,46 @@
.file "example.cpp"
.intel_syntax noprefix
.text
.Ltext0:
.globl s_sA
.section .rodata
.LC0:
.string "hello world!"
.data
.align 8
.type s_sA, @object
.size s_sA, 8
s_sA:
.quad .LC0
.section .rodata
.align 8
.type s_sB, @object
.size s_sB, 10
s_sB:
.string "hey there"
.text
.globl main
.type main, @function
main:
.LFB0:
.file 1 "/tmp/gcc-explorer-compiler116820-58-ewfj5u/example.cpp"
.loc 1 6 0
.cfi_startproc
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
.loc 1 7 0
mov rax, QWORD PTR s_sA[rip]
mov rdi, rax
call puts
.loc 1 8 0
mov edi, OFFSET FLAT:s_sB
call puts
.loc 1 9 0
mov eax, 0
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc

@ -0,0 +1,17 @@
.LC0:
.string "hello world!"
s_sA:
.quad .LC0
s_sB:
.string "hey there"
main:
push rbp
mov rbp, rsp
mov rax, QWORD PTR s_sA[rip]
mov rdi, rax
call puts
mov edi, OFFSET FLAT:s_sB
call puts
mov eax, 0
pop rbp
ret

@ -68,7 +68,6 @@ function testFilter(filename, suffix, filters, withSource) {
assertEq(file[i], lineExpected, expected + ":" + (i + 1));
}
}
cases.forEach(function (x) {
testFilter(x, "", {})
});
@ -91,4 +90,5 @@ cases.forEach(function (x) {
if (failures) {
console.log(failures + " failures");
process.exit(1);
}

Loading…
Cancel
Save