Browse Source

Merge branch 'master' into msvc-spike

Conflicts:
	app.js
	etc/config/gcc-explorer.lud-ldnmg01.properties
	lib/asm.js
	lib/compile.js
	package.json
	static/asm-mode.js
	static/compiler.js
	test/test.js
dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
d11fb2c206
  1. 1
      .bowerrc
  2. 4
      .gitignore
  3. 13
      .idea/codeStyleSettings.xml
  4. 22
      .idea/compiler.xml
  5. 3
      .idea/copyright/profiles_settings.xml
  6. 3
      .idea/gcc-explorer.iml
  7. 4
      .idea/jsLibraryMappings.xml
  8. 14
      .idea/libraries/gcc_explorer_node_modules.xml
  9. 4
      .idea/misc.xml
  10. 4
      .travis.yml
  11. 31
      Makefile
  12. 16
      Notes.md
  13. 37
      README.md
  14. 18
      app.build.js
  15. 100
      app.js
  16. 31
      bower.json
  17. 4
      c-preload/compiler-wrapper
  18. 4
      etc/config/aws.danger.properties
  19. 118
      etc/config/c++.amazon.properties
  20. 47
      etc/config/c++.amazon1204.properties
  21. 11
      etc/config/c++.danger.properties
  22. 1
      etc/config/c++.defaults.properties
  23. 3
      etc/config/c++.lud-ldnmg01.properties
  24. 24
      etc/config/d.amazon.properties
  25. 4
      etc/config/gcc-explorer.amazon.properties
  26. 1
      etc/config/gcc-explorer.danger.properties
  27. 5
      etc/config/gcc-explorer.defaults.properties
  28. 1
      etc/config/gcc-explorer.lud-ldnmg01.properties
  29. 2
      etc/config/go.amazon.properties
  30. 36
      etc/config/rust.amazon.properties
  31. 6
      etc/oldhash.txt
  32. 15
      examples/c++/max_array_opt.cpp
  33. 5
      gdb.txt
  34. 100
      lib/asm.js
  35. 21
      lib/compile.js
  36. 235
      lib/diff.js
  37. 5
      lib/properties.js
  38. 2
      lib/restreamer.js
  39. 6
      package.json
  40. 1483
      static-old/compiler.js
  41. 284
      static-old/gcc.css
  42. 115
      static-old/gcc.js
  43. 363
      static-old/index.html
  44. 0
      static-old/urlshorten-gist.js
  45. 31
      static-old/urlshorten-google.js
  46. 0
      static-old/urlshorten-none.js
  47. 1
      static/.gitignore
  48. 88
      static/analytics.js
  49. 123
      static/asm-mode.js
  50. 0
      static/clippy.svg
  51. 51
      static/colour.js
  52. 731
      static/compiler.js
  53. 324
      static/editor.js
  54. 126
      static/explorer.css
  55. 587
      static/ext/bootstrap/css/bootstrap-theme.css
  56. 1
      static/ext/bootstrap/css/bootstrap-theme.css.map
  57. 6
      static/ext/bootstrap/css/bootstrap-theme.min.css
  58. 1
      static/ext/bootstrap/css/bootstrap-theme.min.css.map
  59. 6760
      static/ext/bootstrap/css/bootstrap.css
  60. 1
      static/ext/bootstrap/css/bootstrap.css.map
  61. 6
      static/ext/bootstrap/css/bootstrap.min.css
  62. 1
      static/ext/bootstrap/css/bootstrap.min.css.map
  63. 2363
      static/ext/bootstrap/js/bootstrap.js
  64. 7
      static/ext/bootstrap/js/bootstrap.min.js
  65. 13
      static/ext/bootstrap/js/npm.js
  66. 7
      static/ext/clipboard.min.js
  67. 336
      static/ext/codemirror/codemirror.css
  68. 21
      static/ext/codemirror/codemirror.js
  69. 4
      static/ext/jquery/jquery-2.2.2.min.js
  70. 1
      static/ext/jquery/jquery-2.2.2.min.map
  71. 1
      static/ext/lz-string/lz-string-1.3.3-min.js
  72. 67
      static/fontscale.js
  73. 114
      static/hub.js
  74. 436
      static/index.html
  75. 66
      static/loadSave.js
  76. 165
      static/main.js
  77. 31
      static/options.js
  78. 108
      static/output.js
  79. 66
      static/rison.js
  80. 41
      static/sharing.js
  81. 69
      static/toggles.js
  82. 121
      static/url.js
  83. 84
      static/urlshorten-google.js
  84. 46
      test/cases/string-constant.asm
  85. 17
      test/cases/string-constant.asm.directives.labels.comments
  86. 2
      test/test.js

1
.bowerrc

@ -0,0 +1 @@
{ "directory": "static/ext" }

4
.gitignore vendored

@ -1,4 +1,6 @@
*.swp
/node_modules
.npm-updated
/.npm-updated
/.bower-updated
/out
*.heapsnapshot

13
.idea/codeStyleSettings.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

22
.idea/compiler.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

3
.idea/copyright/profiles_settings.xml

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

3
.idea/gcc-explorer.iml

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="gcc-explorer node_modules" level="project" />
</component>
</module>

4
.idea/jsLibraryMappings.xml

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{gcc-explorer node_modules}" />
<file url="file://$PROJECT_DIR$" libraries="{gcc-explorer/node_modules}" />
<file url="file://$PROJECT_DIR$/static/ext/golden-layout" libraries="{gcc-explorer/static/ext/golden-layout/node_modules}" />
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>

14
.idea/libraries/gcc_explorer_node_modules.xml

@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="gcc-explorer node_modules" type="javaScript">
<properties>
<option name="frameworkName" value="node_modules" />
<sourceFilesUrls>
<item url="file://$PROJECT_DIR$/node_modules" />
</sourceFilesUrls>
</properties>
<CLASSES>
<root url="file://$PROJECT_DIR$/node_modules" />
</CLASSES>
<SOURCES />
</library>
</component>

4
.idea/misc.xml

@ -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>

4
.travis.yml

@ -1,4 +1,6 @@
sudo: false
language: node_js
node_js:
- "0.12"
- 6

31
Makefile

@ -1,3 +1,8 @@
ifneq "" "$(NODE_DIR)"
NPM:=$(NODE_DIR)/bin/npm
NODE:=$(NODE_DIR)/bin/npm
default: run
else
ifeq "" "$(shell which npm)"
default:
@echo "Please install node.js"
@ -5,12 +10,15 @@ default:
@echo "On Ubuntu/Debian try: sudo apt-get install nodejs npm"
exit 1
else
NPM:= $(shell which npm)
NODE:= $(shell which node || which nodejs)
default: run
endif
endif
.PHONY: clean run test run-amazon c-preload optional-d-support prereqs
prereqs: optional-d-support node_modules c-preload
.PHONY: clean run test run-amazon c-preload optional-d-support prereqs node_modules bower_modules
.PHONY: dist
prereqs: optional-d-support node_modules c-preload bower_modules
ifeq "" "$(shell which gdc)"
optional-d-support:
@ -22,12 +30,19 @@ endif
NODE_MODULES=.npm-updated
$(NODE_MODULES): package.json
npm install
$(NPM) install
@touch $@
BOWER_MODULES=.bower-updated
$(BOWER_MODULES): bower.json $(NODE_MODULES)
if ! test -f "${BOWER_MODULES}"; then rm -rf static/ext; fi
$(NODE) ./node_modules/bower/bin/bower install
@touch $@
LANG:=C++
node_modules: $(NODE_MODULES)
bower_modules: $(BOWER_MODULES)
test:
(cd test; $(NODE) test.js)
@ -35,12 +50,16 @@ test:
@echo Tests pass
clean:
rm -rf node_modules .npm-updated
rm -rf bower_modules node_modules .npm-updated .bower-updated out static/ext
$(MAKE) -C d clean
$(MAKE) -C c-preload clean
run: node_modules optional-d-support c-preload
$(NODE) ./node_modules/.bin/supervisor -e 'js|node|properties' --exec $(NODE) -- ./app.js --language $(LANG)
run: prereqs
$(NODE) ./node_modules/.bin/supervisor -w app.js,lib,etc/config -e 'js|node|properties' --exec $(NODE) -- ./app.js --language $(LANG)
dist: prereqs
$(NODE) ./node_modules/requirejs/bin/r.js -o app.build.js
c-preload:
$(MAKE) -C c-preload

16
Notes.md

@ -1,16 +0,0 @@
In progress
-----------
Currently in progress is the difference view. In order to achieve this we need two "compiler" views; an "A" and "B". I'm in the progress of splitting out all the compiler-specifics into a class of sorts in the mainline, as this is a sensible refactor anyway. In the "diffs" branch I'm sketching out the UI.
Notes:
* storage in both hash tag and in local storage need to change. Specifically they are too tied to the notion of a single compiler.
* should ensure backwards compatibility: store off some hash tags and test the decode to the same view in the new scheme.
* binary mode could be done by compiling to .o (with LTO as necessary) and then decoding result of `objdump -d -C /tmp/temp.o -l -M intel --insn-width=16` (for example).
NB
--
Bug with clicked URLs and race to get the list of compilers (null compiler)

37
README.md

@ -1,18 +1,39 @@
GCC Explorer
[![Build Status](https://travis-ci.org/mattgodbolt/gcc-explorer.svg?branch=master)](https://travis-ci.org/mattgodbolt/gcc-explorer)
[![Codewake](https://www.codewake.com/badges/ask_question.svg)](https://www.codewake.com/p/compiler-explorer)
Compiler Explorer
------------
GCC Explorer is an interactive compiler. The left-hand pane shows editable C/C++ code. The right, the assembly output of having compiled the code with a given compiler and settings.
Compiler Explorer is an interactive compiler. The left-hand pane shows editable C/C++/Rust/Go/D code. The right, the
assembly output of having compiled the code with a given compiler and settings. Multiple compilers are supported, and
the UI layout is configurable (the [Golden Layout](https://www.golden-layout.com/) library is used for this).
Try out the [demo site][demo]!
Try out one of the demo sites: [C++][cpp], [Rust][rust], [D][d] or [Go][go].
[demo]: http://gcc.godbolt.org/
[cpp]: https://gcc.godbolt.org/ "Compiler Explorer for C++"
[rust]: https://rust.godbolt.org/ "Compiler Explorer for Rust"
[d]: https://d.godbolt.org/ "Compiler Explorer for D"
[go]: https://go.godbolt.org/ "Compiler Explorer for Go"
### Developing
GCC Explorer is written in node.
Compiler Explorer is written in node.js.
Assuming you have npm and node installed, simply running `make` ought to get you up and running with an Explorer
running on port 10240 on your local machine: http://localhost:10240/
The `Makefile` will automatically install all the third party libraries needed to run; using `npm` to install server-side
components and `bower` to install all the client-facing libraries.
If you want to point it at your own GCC or similar binaries,either edit the
`etc/config/gcc-explorer.defaults.properties` or else make a new one with the name
`gcc-explorer.YOURHOSTNAME.properties`. The config system leaves a lot to be desired,
I'm working on porting [CCS](https://github.com/hellige/ccs-cpp) to javascript and then something more rational can be used.
Assuming you have npm and node installed, simply running `make` ought to get you up and running with a GCC explorer running on port 10240 on your local machine: http://localhost:10240
Feel free to raise an issue on [github](https://github.com/mattgodbolt/gcc-explorer/issues) or
[email me directly](mailto:matt@godbolt.org) for more help.
If you want to point it at your own GCC or similar binaries, either edit the `etc/config/gcc-explorer.defaults.properties` or else make a new one with the name `gcc-explorer.YOURHOSTNAME.properties`. The config system leaves a lot to be desired, I'm working on porting [CCS](https://github.com/hellige/ccs-cpp) to javascript and then something more rational can be used.
### Credits
Feel free to raise an issue on [github](https://github.com/mattgodbolt/gcc-explorer/issues) or [email me directly](mailto:matt@godbolt.org) for more help.
Compiler Explorer is maintained by [Matt Godbolt](http://xania.org). Multiple compiler and difference view was
implemented by [Gabriel Devillers](https://github.com/voxelf).

18
app.build.js

@ -0,0 +1,18 @@
({
appDir: "static",
baseUrl: ".",
dir: "out/dist",
generateSourceMaps: true,
preserveLicenseComments: false,
optimize: "uglify2",
removeCombined: true,
useStrict: true,
mainConfigFile: "static/main.js",
skipDirOptimize: true,
optimizeCss: "standard",
modules: [
{
name: "main"
}
]
})

100
app.js

@ -24,10 +24,12 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// load external and internal libraries (will load more internal binaries later)
var nopt = require('nopt'),
os = require('os'),
props = require('./lib/properties'),
CompileHandler = require('./lib/compile').CompileHandler,
buildDiffHandler = require('./lib/diff').buildDiffHandler,
express = require('express'),
child_process = require('child_process'),
path = require('path'),
@ -37,22 +39,27 @@ var nopt = require('nopt'),
url = require('url'),
Promise = require('promise'),
aws = require('./lib/aws'),
_ = require('underscore');
_ = require('underscore-node');
// Parse arguments from command line 'node ./app.js args...'
var opts = nopt({
'env': [String, Array],
'rootDir': [String],
'language': [String],
'host': [String],
'port': [Number],
'propDebug': [Boolean]
'propDebug': [Boolean],
'static': [String]
});
// Set default values for ommited arguments
var rootDir = opts.rootDir || './etc';
var language = opts.language || "C++";
var env = opts.env || ['dev'];
var hostname = opts.host || os.hostname();
var port = opts.port || 10240;
var staticDir = opts.static || 'static';
var gitReleaseName = child_process.execSync('git rev-parse HEAD').toString().trim();
var propHierarchy = [
'defaults',
@ -61,16 +68,35 @@ var propHierarchy = [
env + '.' + process.platform,
process.platform,
os.hostname()];
console.log("properties hierarchy: " + propHierarchy);
props.initialize(rootDir + '/config', propHierarchy);
// Propagate debug mode if need be
if (opts.propDebug) props.setDebug(true);
// *All* files in config dir are parsed
props.initialize(rootDir + '/config', propHierarchy);
// Instantiate a function to access records concerning "gcc-explorer"
// in hidden object props.properties
var gccProps = props.propsFor("gcc-explorer");
// Read from gccexplorer's config the wdiff configuration
// that will be used to configure lib/diff.js
var wdiffConfig = {
wdiffExe: gccProps('wdiff', "wdiff"),
maxOutput: gccProps("max-diff-output", 100000)
};
// Instantiate a function to access records concerning the chosen language
// in hidden object props.properties
var compilerPropsFunc = props.propsFor(language.toLowerCase());
// If no option for the compiler ... use gcc's options (??)
function compilerProps(property, defaultValue) {
// My kingdom for ccs...
// My kingdom for ccs... [see Matt's github page]
var forCompiler = compilerPropsFunc(property, undefined);
if (forCompiler !== undefined) return forCompiler;
return gccProps(property, defaultValue);
return gccProps(property, defaultValue); // gccProps comes from lib/compile.js
}
require('./lib/compile').initialise(gccProps, compilerProps);
var staticMaxAgeMs = gccProps('staticMaxAgeMs', 0);
@ -82,6 +108,7 @@ function awsInstances() {
return awsPoller.getInstances();
}
// function to load internal binaries (i.e. lib/source/*.js)
function loadSources() {
var sourcesDir = "lib/sources";
var sources = fs.readdirSync(sourcesDir)
@ -94,12 +121,14 @@ function loadSources() {
return sources;
}
// load effectively
var fileSources = loadSources();
var sourceToHandler = {};
fileSources.forEach(function (source) {
sourceToHandler[source.urlpart] = source;
});
// auxiliary function used in clientOptionsHandler
function compareOn(key) {
return function (xObj, yObj) {
var x = xObj[key];
@ -110,20 +139,21 @@ function compareOn(key) {
};
}
// instantiate a function that generate javascript code,
function ClientOptionsHandler(fileSources) {
var sources = fileSources.map(function (source) {
return {name: source.name, urlpart: source.urlpart};
});
// sort source file alphabetically
sources = sources.sort(compareOn("name"));
var text = "";
this.setCompilers = function (compilers) {
var options = {
google_analytics_account: gccProps('clientGoogleAnalyticsAccount', 'UA-55180-6'),
google_analytics_enabled: gccProps('clientGoogleAnalyticsEnabled', false),
sharing_enabled: gccProps('clientSharingEnabled', true),
github_ribbon_enabled: gccProps('clientGitHubRibbonEnabled', true),
urlshortener: gccProps('clientURLShortener', 'google'),
gapiKey: gccProps('google-api-key', 'AIzaSyAaz35KJv8DA0ABoime0fEIh32NmbyYbcQ'),
googleAnalyticsAccount: gccProps('clientGoogleAnalyticsAccount', 'UA-55180-6'),
googleAnalyticsEnabled: gccProps('clientGoogleAnalyticsEnabled', false),
sharingEnabled: gccProps('clientSharingEnabled', true),
githubEnabled: gccProps('clientGitHubRibbonEnabled', true),
gapiKey: gccProps('googleApiKey', ''),
googleShortLinkRewrite: gccProps('googleShortLinkRewrite', '').split('|'),
defaultSource: gccProps('defaultSource', ''),
language: language,
@ -132,18 +162,22 @@ function ClientOptionsHandler(fileSources) {
defaultCompiler: compilerProps('defaultCompiler', ''),
compileOptions: compilerProps("options"),
supportsBinary: !!compilerProps("supportsBinary"),
sources: sources
postProcess: compilerProps("postProcess"),
sources: sources,
raven: gccProps('ravenUrl', ''),
release: gitReleaseName,
environment: env
};
text = "var OPTIONS = " + JSON.stringify(options) + ";";
};
this.setCompilers([]);
text = JSON.stringify(options);
}
this.handler = function getClientOptions(req, res) {
res.set('Content-Type', 'application/javascript');
res.set('Content-Type', 'application/json');
res.set('Cache-Control', 'public, max-age=' + staticMaxAgeMs);
res.end(text);
};
}
// function used to enable loading and saving source code from web interface
function getSource(req, res, next) {
var bits = req.url.split("/");
var handler = sourceToHandler[bits[1]];
@ -194,7 +228,9 @@ function retryPromise(promiseFunc, name, maxFails, retryMs) {
});
}
// Auxiliary function to findCompilers()
function configuredCompilers() {
// read config (file already read) (':' are used to separate compilers names)
var exes = compilerProps("compilers", "/usr/bin/g++").split(":");
var ndk = compilerProps('androidNdk');
if (ndk) {
@ -294,11 +330,13 @@ function configuredCompilers() {
isCl: !!props("isCl", false),
intelAsm: props("intelAsm", ""),
needsMulti: !!props("needsMulti", true),
supportsBinary: !!props("supportsBinary", true)
supportsBinary: !!props("supportsBinary", true),
postProcess: props("postProcess", "")
});
})).then(_.flatten);
}
// Auxiliary function to findCompilers()
function getCompilerInfo(compilerInfo) {
if (compilerInfo.remote) {
return Promise.resolve(compilerInfo);
@ -306,12 +344,16 @@ function getCompilerInfo(compilerInfo) {
return new Promise(function (resolve) {
var compiler = compilerInfo.exe;
var versionFlag = compilerInfo.versionFlag || '--version';
// fill field compilerInfo.version,
// assuming the compiler returns it's version on 1 line
child_process.exec('"' + compiler + '" ' + versionFlag, function (err, output) {
if (err) return resolve(null);
compilerInfo.version = output.split('\n')[0];
if (compilerInfo.intelAsm) {
return resolve(compilerInfo);
}
// get informations on the compiler's options
child_process.exec(compiler + ' --target-help', function (err, output) {
var options = {};
if (!err) {
@ -325,6 +367,10 @@ function getCompilerInfo(compilerInfo) {
if (options['-masm']) {
compilerInfo.intelAsm = "-masm=intel";
}
// debug (seems to be displayed multiple times):
if (opts.propDebug) console.log("compiler options: " + JSON.stringify(options, null, 4));
resolve(compilerInfo);
});
});
@ -340,13 +386,13 @@ function findCompilers() {
compilers = compilers.filter(function (x) {
return x !== null;
});
compilers = compilers.sort(function (x, y) {
return x.name < y.name ? -1 : x.name > y.name ? 1 : 0;
});
compilers = compilers.sort(compareOn("name"));
return compilers;
});
}
// Instantiate a function that write informations on compiler,
// in JSON format (on which page ?)
function ApiHandler() {
var reply = "";
this.setCompilers = function (compilers) {
@ -442,24 +488,28 @@ findCompilers().then(function (compilers) {
bodyParser = require('body-parser'),
logger = require('morgan'),
compression = require('compression'),
restreamer = require('./lib/restreamer');
restreamer = require('./lib/restreamer'),
diffHandler = buildDiffHandler(wdiffConfig);
webServer
.use(logger('combined'))
.use(compression())
.use(sFavicon('static/favicon.ico'))
.use(sStatic('static', {maxAge: staticMaxAgeMs}))
.use(sFavicon(staticDir + '/favicon.ico'))
.use(sStatic(staticDir, {maxAge: staticMaxAgeMs}))
.use(bodyParser.json())
.use(restreamer())
.get('/client-options.js', clientOptionsHandler.handler)
.get('/client-options.json', clientOptionsHandler.handler)
.use('/source', getSource)
.use('/api', apiHandler.handler)
.use('/g', shortUrlHandler)
.post('/compile', compileHandler.handler);
.post('/compile', compileHandler.handler) // used inside static/compiler.js
.post('/diff', diffHandler); // used inside static/compiler.js
// GO!
console.log("=======================================");
console.log("Listening on http://" + hostname + ":" + port + "/");
console.log(" serving static files from '" + staticDir + "'");
console.log(" git release " + gitReleaseName);
console.log("=======================================");
webServer.listen(port, hostname);
}).catch(function (err) {

31
bower.json

@ -0,0 +1,31 @@
{
"name": "gcc-explorer",
"description": "Interactively investigate compiler output",
"main": "./app.js",
"authors": [
"Matt Godbolt"
],
"license": "BSD-2-Clause",
"homepage": "https://github.com/mattgodbolt/gcc-explorer",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"codemirror": "CodeMirror#^5.17.0",
"requirejs": "^2.2.0",
"underscore": "^1.8.3",
"golden-layout": "^1.5.6",
"jquery": "^3.1.0",
"bootstrap": "^3.3.7",
"selectize": "^0.12.2",
"eventEmitter": "^5.1.0",
"lz-string": "^1.4.4",
"clipboard": "^1.5.12",
"raven-js": "^3.7.0"
}
}

4
c-preload/compiler-wrapper

@ -1,8 +1,8 @@
#/bin/sh
#!/bin/sh
export LD_PRELOAD=$(dirname $0)/libpreload.so
export ALLOWED_FOR_CREATE=/tmp
export ALLOWED_FOR_READ=/usr/local/include:/usr/include:/usr/lib:/lib:/lib64:/usr/msp430:/usr/arm-linux-gnueabi:/tmp:/opt/:/dev/urandom:/etc/lsb-release:/etc/debian_version:/proc/self:/proc/self/maps:/usr/arm-linux-gnueabihf:/usr/aarch64-linux-gnu:/usr/powerpc-linux-gnu/include:/usr/lib/x86_64-linux-gnu
export ALLOWED_FOR_READ=/usr/local/include:/usr/include:/usr/lib:/lib:/lib64:/usr/msp430:/usr/arm-linux-gnueabi:/tmp:/opt/:/dev/urandom:/etc/lsb-release:/etc/debian_version:/proc/self:/proc/self/maps:/usr/arm-linux-gnueabihf:/usr/aarch64-linux-gnu:/usr/powerpc-linux-gnu/include:/usr/lib/x86_64-linux-gnu:/usr/mips-linux-gnu:/usr/mipsel-linux-gnu:/usr/mips64-linux-gnuabi64:/usr/mips64el-linux-gnuabi64:/gcc-explorer
export DENIED=/proc/self/cwd:/proc/self/root:/proc/self/exe
# Last-gasp limits
ulimit -t 5 # CPU time in seconds

4
etc/config/aws.danger.properties

@ -0,0 +1,4 @@
region=us-east-1
tagKey=Name
tagValue=Sven
externalTestMode=true

118
etc/config/c++.amazon.properties

@ -1,40 +1,85 @@
compilers=gcc1204@20480:clang350:clang351:g482:g492:g510:g520:g530:ppcg48:aarchg48:armhfg482:clang37x:clang36x:clang371:clang380:g6
defaultCompiler=g530
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:icc16:icc17
defaultCompiler=g62
###############################
# GCC for x86
compiler.g482.exe=/usr/bin/g++-4.8
compiler.g482.name=x86 gcc 4.8.2
compiler.g492.exe=/usr/bin/g++-4.9
compiler.g492.name=x86 gcc 4.9.2
compiler.g510.exe=/opt/gcc-5.1.0/bin/g++
compiler.g510.name=x86 gcc 5.1
compiler.g520.exe=/opt/gcc-5.2.0/bin/g++
compiler.g520.name=x86 gcc 5.2
compiler.g530.exe=/opt/gcc-5.3.0/bin/g++
compiler.g530.name=x86 gcc 5.3
compiler.g6.exe=/opt/gcc-6.1.0/bin/g++
compiler.g6.name=x86 gcc 6.1
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.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 clang 3.5
compiler.clang350.name=x86-64 clang 3.5
compiler.clang350.intelAsm=-masm=intel
compiler.clang351.exe=/opt/clang+llvm-3.5.1-x86_64-linux-gnu/bin/clang++
compiler.clang351.name=x86 clang 3.5.1
compiler.clang351.exe=/opt/gcc-explorer/clang+llvm-3.5.1-x86_64-linux-gnu/bin/clang++
compiler.clang351.name=x86-64 clang 3.5.1
compiler.clang351.intelAsm=-masm=intel
compiler.clang352.exe=/opt/clang+llvm-3.5.2-x86_64-linux-gnu/bin/clang++
compiler.clang352.name=x86 clang 3.5.2
compiler.clang352.exe=/opt/gcc-explorer/clang+llvm-3.5.2-x86_64-linux-gnu/bin/clang++
compiler.clang352.name=x86-64 clang 3.5.2
compiler.clang352.intelAsm=-masm=intel
compiler.clang36x.exe=/opt/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang36x.name=x86 clang 3.6
compiler.clang36x.exe=/opt/gcc-explorer/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang36x.name=x86-64 clang 3.6
compiler.clang36x.intelAsm=-masm=intel
compiler.clang37x.exe=/opt/clang+llvm-3.7.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang37x.name=x86 clang 3.7
compiler.clang37x.exe=/opt/gcc-explorer/clang+llvm-3.7.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang37x.name=x86-64 clang 3.7
compiler.clang37x.intelAsm=-masm=intel
compiler.clang371.exe=/opt/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang371.name=x86 clang 3.7.1
compiler.clang371.exe=/opt/gcc-explorer/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang371.name=x86-64 clang 3.7.1
compiler.clang371.intelAsm=-masm=intel
compiler.clang380.exe=/opt/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++
compiler.clang380.name=x86 clang 3.8
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
compiler.icc16.exe=/opt/gcc-explorer/intel/xe_2016_update3/bin/icc
compiler.icc16.name=x86-64 icc 16
compiler.icc16.intelAsm=-masm=intel
compiler.icc16.needsMulti=false
compiler.icc17.exe=/opt/gcc-explorer/intel/2017/bin/icc
compiler.icc17.name=x86-64 icc 17
compiler.icc17.intelAsm=-masm=intel
compiler.icc17.needsMulti=false
###############################
# GCC for ppc
@ -53,3 +98,22 @@ compiler.armhfg482.supportsBinary=false
compiler.aarchg48.supportsBinary=false
compiler.armhfg482.needsMulti=false
compiler.aarchg48.needsMulti=false
###############################
# GCC for MIPS
compiler.mips5.exe=/usr/bin/mips-linux-gnu-g++-5
compiler.mips5.name=MIPS gcc 5.4
compiler.mips5el.exe=/usr/bin/mipsel-linux-gnu-g++-5
compiler.mips5el.name=MIPS gcc 5.4 (el)
compiler.mips564.exe=/usr/bin/mips64-linux-gnuabi64-g++-5
compiler.mips564.name=MIPS64 gcc 5.4
compiler.mips564el.exe=/usr/bin/mips64el-linux-gnuabi64-g++-5
compiler.mips564el.name=MIPS64 gcc 5.4 (el)
compiler.mips5.needsMulti=false
compiler.mips5.supportsBinary=false
compiler.mips5el.needsMulti=false
compiler.mips5el.supportsBinary=false
compiler.mips564.needsMulti=false
compiler.mips564.supportsBinary=false
compiler.mips564el.needsMulti=false
compiler.mips564el.supportsBinary=false

47
etc/config/c++.amazon1204.properties

@ -1,40 +1,21 @@
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
compiler.g447.alias=/usr/bin/g++-4.4
compiler.g447.name=x86 gcc 4.4.7
compiler.g447.name=x86-64 gcc 4.4.7
compiler.g453.exe=/usr/bin/g++-4.5
compiler.g453.alias=/usr/bin/g++-4.5
compiler.g453.name=x86 gcc 4.5.3
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 gcc 4.6.4
compiler.g473.exe=/usr/bin/g++-4.7
compiler.g473.alias=/usr/bin/g++-4.7
compiler.g473.name=x86 gcc 4.7.3
compiler.g481.exe=/usr/bin/g++-4.8
compiler.g481.alias=/usr/bin/g++-4.8
compiler.g481.name=x86 gcc 4.8.1
compiler.g490.exe=/opt/gcc-4.9.0/bin/g++
compiler.g490.alias=/opt/gcc-4.9.0/bin/g++
compiler.g490.name=x86 gcc 4.9.0
compiler.g490.supportsBinary=false
# GCC (concepts branch) for x86
compiler.g490c1.exe=/opt/gcc-4.9.0-with-concepts/bin/g++
compiler.g490c1.alias=/opt/gcc-4.9.0-with-concepts/bin/g++
compiler.g490c1.name=x86 gcc 4.9.0 (w/concepts)
compiler.g490c1.supportsBinary=false
compiler.g490c2.exe=/opt/gcc-4.9.0-0909-concepts/bin/g++
compiler.g490c2.alias=/opt/gcc-4.9.0-0909-concepts/bin/g++
compiler.g490c2.name=x86 gcc 4.9.0 (w/concepts)
compiler.g490c2.supportsBinary=false
compiler.g464.name=x86-64 gcc 4.6.4
# Intel for x86
compiler.icc1301.exe=/opt/intel/bin/icc
compiler.icc1301.exe=/opt/gcc-explorer/intel/bin/icc
compiler.icc1301.alias=/opt/intel/bin/icc
compiler.icc1301.name=x86 icc 13.0.1
compiler.icc1301.name=x86-64 icc 13.0.1
compiler.icc1301.intelAsm=-masm=intel
compiler.icc1301.needsMulti=false
# intel binary disabled for now TODO why does it segfault? preload?
@ -42,19 +23,19 @@ compiler.icc1301.supportsBinary=false
# Clang for x86
compiler.clang30.exe=/usr/bin/clang++
compiler.clang30.alias=/usr/bin/clang++
compiler.clang30.name=x86 clang 3.0
compiler.clang30.name=x86-64 clang 3.0
compiler.clang30.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang32.exe=/opt/clang-3.2/bin/clang++
compiler.clang32.exe=/opt/gcc-explorer/clang-3.2/bin/clang++
compiler.clang32.alias=/opt/clang-3.2/bin/clang++
compiler.clang32.name=x86 clang 3.2
compiler.clang32.name=x86-64 clang 3.2
compiler.clang32.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang33.exe=/opt/clang-3.3/bin/clang++
compiler.clang33.exe=/opt/gcc-explorer/clang-3.3/bin/clang++
compiler.clang33.alias=/opt/clang-3.3/bin/clang++
compiler.clang33.name=x86 clang 3.3
compiler.clang33.name=x86-64 clang 3.3
compiler.clang33.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang341.exe=/opt/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04/bin/clang++
compiler.clang341.exe=/opt/gcc-explorer/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04/bin/clang++
compiler.clang341.alias=/opt/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04/bin/clang++
compiler.clang341.name=x86 clang 3.4.1
compiler.clang341.name=x86-64 clang 3.4.1
compiler.clang341.intelAsm=-mllvm --x86-asm-syntax=intel
###############################

11
etc/config/c++.danger.properties

@ -0,0 +1,11 @@
# Matt's home development computer
defaultCompiler=g54
compilers=g54:g47:g48
#compilers=localhost@20480
compiler.g54.exe=/usr/bin/g++
compiler.g54.name=g++ 5.4
compiler.g47.exe=/usr/bin/g++-4.7
compiler.g47.name=g++ 4.7
compiler.g48.exe=/usr/bin/g++-4.8
compiler.g48.name=g++ 4.8
#compiler-wrapper=./c-preload/compiler-wrapper

1
etc/config/c++.defaults.properties

@ -1,5 +1,6 @@
# Default settings for C++
compilers=/usr/bin/g++-4.4:/usr/bin/g++-4.5:/usr/bin/g++-4.6:/usr/bin/g++-4.7:/usr/bin/clang++:/usr/bin/g++
defaultCompiler=/usr/bin/g++
compileFilename=example.cpp
postProcess=c++filt
#androidNdk=/opt/google/android-ndk-r9c

3
etc/config/c++.lud-ldnmg01.properties

@ -1,6 +1,7 @@
# Default settings for GCC Explorer.
defaultCompiler=g52
compilers=g44:g45:g46:clang35:g51:g52:gdef:AWS
compilers=g44:g45:g46:clang35:g51:g52:gdef
#compilers=g44:g45:g46:clang35:g51:g52:gdef:AWS
#compilers=localhost@20480
compiler.g44.exe=/usr/bin/g++-4.4
compiler.g44.name=g++ 4.4

24
etc/config/d.amazon.properties

@ -1,14 +1,12 @@
compilers=gdc44:gdc46:gdc49u:gdc49
defaultCompiler=gdc49
compiler.gdc44.exe=/usr/bin/gdc-4.4
compiler.gdc44.alias=/usr/bin/gdc-4.4
compiler.gdc44.name=gdc 4.4 (Ubuntu)
compiler.gdc46.exe=/usr/bin/gdc-4.6
compiler.gdc46.alias=/usr/bin/gdc-4.6
compiler.gdc46.name=gdc 4.6 (Ubuntu)
compiler.gdc49u.exe=/usr/bin/gdc-4.9
compiler.gdc49u.alias=/usr/bin/gdc-4.9
compiler.gdc49u.name=gdc 4.9 (Ubuntu)
compiler.gdc49.exe=/opt/x86_64-gdcproject-linux-gnu/bin/gdc
compilers=gdc48:gdc49:gdc52
defaultCompiler=gdc52
# URL compatibility...
compiler.gdc49.exe=/opt/gcc-explorer/gdc4.9.3/x86_64-pc-linux-gnu/bin/gdc
compiler.gdc49.alias=/opt/x86_64-gdcproject-linux-gnu/bin/gdc
compiler.gdc49.name=gdc 2.066.1 (4.9)
compiler.gdc49.name=gdc 4.9.3
compiler.gdc48.exe=/opt/gcc-explorer/gdc4.8.2/x86_64-gdcproject-linux-gnu/bin/gdc
compiler.gdc48.name=gdc 4.8.2
compiler.gdc52.exe=/opt/gcc-explorer/gdc5.2.0/x86_64-pc-linux-gnu/bin/gdc
compiler.gdc52.name=gdc 5.2.0

4
etc/config/gcc-explorer.amazon.properties

@ -1,9 +1,11 @@
# Settings overridden for Amazon EC2 instances that power http://*.godbolt.org/
googleApiKey=AIzaSyAaz35KJv8DA0ABoime0fEIh32NmbyYbcQ
compileTimeoutMs=5000
compiler-wrapper=./c-preload/compiler-wrapper
max-asm-size=8388608
staticMaxAgeMs=600000
staticMaxAgeMs=30000
cacheMb=50
clientGoogleAnalyticsEnabled=true
proxyRetries=300
proxyRetryMs=500
ravenUrl=https://8e4614f649ad4e3faf3e7e8827b935f9@sentry.io/102028

1
etc/config/gcc-explorer.danger.properties

@ -0,0 +1 @@
ravenUrl=https://8e4614f649ad4e3faf3e7e8827b935f9@sentry.io/102028

5
etc/config/gcc-explorer.defaults.properties

@ -8,5 +8,8 @@ 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
max-diff-output=100000

1
etc/config/gcc-explorer.lud-ldnmg01.properties

@ -1,3 +1,4 @@
language=C++
clientURLShortener=google
rescanCompilerSecs=360
ravenUrl=https://8e4614f649ad4e3faf3e7e8827b935f9@sentry.io/102028

2
etc/config/go.amazon.properties

@ -3,7 +3,7 @@ compilers=gccgo491:6g141
compileFilename=file.go
compiler.gccgo491.exe=/usr/bin/gccgo
compiler.gccgo491.name=x86 gccgo 4.9.1
compiler.6g141.exe=/opt/go/pkg/tool/linux_amd64/6g
compiler.6g141.exe=/opt/gcc-explorer/go/pkg/tool/linux_amd64/6g
compiler.6g141.name=x86 6g 1.4.1
compiler.6g141.versionFlag=-V
compiler.6g141.is6g=true

36
etc/config/rust.amazon.properties

@ -1,32 +1,44 @@
compilers=r170:r160:r150:r140:r130:r120:r110:r100:nightly:beta
defaultCompiler=r170
compiler.r170.exe=/opt/rust-1.7.0/bin/rustc
compilers=r1110:r1100:r190:r180:r170:r160:r150:r140:r130:r120:r110:r100:nightly:beta
defaultCompiler=r1110
compiler.r1110.exe=/opt/gcc-explorer/rust-1.11.0/bin/rustc
compiler.r1110.name=rustc 1.11.0
compiler.r1110.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r1100.exe=/opt/gcc-explorer/rust-1.10.0/bin/rustc
compiler.r1100.name=rustc 1.10.0
compiler.r1100.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r190.exe=/opt/gcc-explorer/rust-1.9.0/bin/rustc
compiler.r190.name=rustc 1.9.0
compiler.r190.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r180.exe=/opt/gcc-explorer/rust-1.8.0/bin/rustc
compiler.r180.name=rustc 1.8.0
compiler.r180.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r170.exe=/opt/gcc-explorer/rust-1.7.0/bin/rustc
compiler.r170.name=rustc 1.7.0
compiler.r170.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r160.exe=/opt/rust-1.6.0/bin/rustc
compiler.r160.exe=/opt/gcc-explorer/rust-1.6.0/bin/rustc
compiler.r160.name=rustc 1.6.0
compiler.r160.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r150.exe=/opt/rust-1.5.0/bin/rustc
compiler.r150.exe=/opt/gcc-explorer/rust-1.5.0/bin/rustc
compiler.r150.name=rustc 1.5.0
compiler.r150.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r140.exe=/opt/rust-1.4.0/bin/rustc
compiler.r140.exe=/opt/gcc-explorer/rust-1.4.0/bin/rustc
compiler.r140.name=rustc 1.4.0
compiler.r140.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r130.exe=/opt/rust-1.3.0/bin/rustc
compiler.r130.exe=/opt/gcc-explorer/rust-1.3.0/bin/rustc
compiler.r130.name=rustc 1.3.0
compiler.r130.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r120.exe=/opt/rust-1.2.0/bin/rustc
compiler.r120.exe=/opt/gcc-explorer/rust-1.2.0/bin/rustc
compiler.r120.name=rustc 1.2.0
compiler.r120.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r110.exe=/opt/rust-1.1.0/bin/rustc
compiler.r110.exe=/opt/gcc-explorer/rust-1.1.0/bin/rustc
compiler.r110.name=rustc 1.1.0
compiler.r110.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.r100.exe=/opt/rust-1.0.0/bin/rustc
compiler.r100.exe=/opt/gcc-explorer/rust-1.0.0/bin/rustc
compiler.r100.name=rustc 1.0.0
compiler.r100.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.nightly.exe=/opt/rust-nightly/bin/rustc
compiler.nightly.exe=/opt/gcc-explorer/rust-nightly/bin/rustc
compiler.nightly.name=rustc nightly (version varies)
compiler.nightly.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
compiler.beta.exe=/opt/rust-beta/bin/rustc
compiler.beta.exe=/opt/gcc-explorer/rust-beta/bin/rustc
compiler.beta.name=rustc beta (version varies)
compiler.beta.intelAsm=-Cllvm-args=--x86-asm-syntax=intel

6
etc/oldhash.txt

@ -1,2 +1,6 @@
http://localhost:10240/#%7B%22version%22%3A2%2C%22source%22%3A%22%23include%20%3Cxmmintrin.h%3E%5Cn%5Cnvoid%20f(__m128%20a%2C%20__m128%20b)%5Cn%7B%5Cn%20%20%2F%2F%20I%20am%20a%20walrus.%5Cn%7D%22%2C%22compiler%22%3A%22%2Fhome%2Fmgodbolt%2Fapps%2Fintel-icc-oss%2Fbin%2Ficc%22%2C%22options%22%3A%22-O3%20-std%3Dc%2B%2B0x%22%2C%22filterAsm%22%3A%7B%22labels%22%3Atrue%2C%22directives%22%3Atrue%7D%7D
http://lud-ldnmg01:10240/#%7B%22version%22%3A2%2C%22source%22%3A%22%23include%20%3Cxmmintrin.h%3E%5Cn%5Cnvoid%20f(__m128%20a%2C%20__m128%20b)%5Cn%7B%5Cn%20%20%2F%2F%20I%20am%20a%20walrus.%5Cn%7D%22%2C%22compiler%22%3A%22%2Fhome%2Fmgodbolt%2Fapps%2Fintel-icc-oss%2Fbin%2Ficc%22%2C%22options%22%3A%22-O3%20-std%3Dc%2B%2B0x%22%2C%22filterAsm%22%3A%7B%22labels%22%3Atrue%2C%22directives%22%3Atrue%7D%7D
-- should be icc, "-O3 -std=c++0x", all filters but comments
http://lud-ldnmg01:10240/#compilers:!((compiler:g7snapshot,options:'-std%3Dc%2B%2B1z+-O3+',source:'%23include+%3Cvector%3E%0A%0Astruct+Widget+%7B%0A++int+n%3B%0A++double+x,+y%3B%0A++Widget(const+Widget%26+o)+:+x(o.x),+y(o.y),+n(o.n)+%7B%7D%0A++Widget(int+n,+double+x,+double+y)+:+n(n),+x(x),+y(y)+%7B%7D%0A%7D%3B%0A%0Astd::vector%3CWidget%3E+vector%3B%0Aconst+int+N+%3D+1002%3B%0Adouble+a+%3D+0.1%3B%0Adouble+b+%3D+0.2%3B%0A%0Avoid+demo()+%7B%0A++vector.reserve(N)%3B%0A++for+(int+i+%3D+01%3B+i+%3C+N%3B+%2B%2Bi)%0A++%7B%0A%09Widget+w+%7Bi,+a,+b%7D%3B%0A%09vector.push_back(w)%3B+//+or+vector.push_back(std::move(w))%0A++%7D%0A%7D%0A%0Aint+main()%0A%7B%0A+%0A+%0A%7D%0A')),filterAsm:(colouriseAsm:!t,commentOnly:!t,directives:!t,intel:!t,labels:!t),version:3
-- should be GCC 7, with widgets source. Binary mode off, all other labels on. -std=c++1z -O3
http://lud-ldnmg01:10240/#compilers:!((compiler:g474,options:'',sourcez:PQKgBALgpgzhYHsBmYDGCC2AHATrGAlggHYB0pamGUx8AFlHmEgjmADY0DmEdAXACgAhiNFjxEyVOkzZw2QsVLl85WvVrVG7TolbdB7fsMmlx0xennLNsddu37Dy0%2BenXbwx8%2B7vPo/7OfoGaIMACAgS0YBhCUQAUUfBCOFyoADSUxHBodClgICApXABuAJRgAN4CYGB4EACuOMRgAIwATADcAgC%2BQAA)),filterAsm:(binary:!t,colouriseAsm:!t,commentOnly:!t,directives:!t,intel:!t,labels:!t),version:3
-- should be 4.7.4, no options, binary, intel, colourise.

15
examples/c++/max_array_opt.cpp

@ -1,16 +1,7 @@
// Compile with -O3 -march=native to see autovectorization
void maxArray(double* __restrict x, double* __restrict y) {
// Alignment hints supported on GCC 4.7+ and any compiler
// supporting the appropriate builtin (clang 3.6+).
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
#if __GNUC__ > 4 \
|| (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \
|| __has_builtin(__builtin_assume_aligned)
x = static_cast<double*>(__builtin_assume_aligned(x, 64));
y = static_cast<double*>(__builtin_assume_aligned(y, 64));
#endif
typedef double __attribute__((aligned(64))) aligned_double;
void maxArray(aligned_double* __restrict x, aligned_double* __restrict y) {
for (int i = 0; i < 65536; i++) {
x[i] = ((y[i] > x[i]) ? y[i] : x[i]);
}

5
gdb.txt

@ -1,5 +0,0 @@
Reading symbols from /grid/opt/zindex/zq...done.
quit
Reading symbols from /grid/opt/zindex/zindex...done.
Quit
quit

100
lib/asm.js

@ -23,6 +23,7 @@
// POSSIBILITY OF SUCH DAMAGE.
(function () {
var _ = require('underscore-node');
var tabsRe = /\t/g;
function expandTabs(line) {
@ -35,37 +36,92 @@
});
}
function processAsm(asm, filters) {
if (asm.match(/^; Listing generated by Microsoft/)) return processClAsm(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 result = [];
var asmLines = asm.split(/\r?\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;
}
var directive = /^\s*(\.|([_A-Z]+\b))/;
var labelDefinition = /^([a-zA-Z0-9$_.]+):/;
var commentOnly = /^\s*([#@;]|\/\/).*/;
function processAsm(asm, filters) {
if (asm.match(/^; Listing generated by Microsoft/)) return processClAsm(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 commentOnly = /^\s*(#|@|\/\/).*/;
var sourceTag = /^\s*\.loc\s+(\d+)\s+(\d+).*/;
var stdInLooking = /.*<stdin>|-/;
var endBlock = /\.(cfi_endproc|data|text|section)/;
@ -90,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) {
@ -196,12 +252,12 @@
return result;
}
// TODO: dedupe with the above code
// TODO: support weak refs etc
function processClAsm(asm, filters) {
var asmLines = asm.split(/\r?\n/);
var labelsUsed = {};
var labelFind = /[.a-zA-Z0-9_$][a-zA-Z0-9$_.]*/g;
var prevLabel = "";
var dataDefn = /\.(string|asciz|ascii|[1248]?byte|short|word|long|quad|value|zero)/;
// With FAsc we rely on seeing a bunch of opcodes on a line to detect an instruction
var hasOpcode = /^\s*([0-9a-f]+\s+)+[a-zA-Z].*/;
asmLines.forEach(function (line) {
@ -217,7 +273,7 @@
});
var directive = /^\s*(\.|([_A-Z]+\b))/;
var labelDefinition = /^([a-zA-Z0-9$_.]+):/;
var labelDefinition = /^([a-zA-Z0-9$_.]+):/; // NB not same as outer labelDef TODO dedupe
var commentOnly = /^\s*([#@;]|\/\/).*/;
var endBlock = /^[^ ]+\s+ENDP/;
var fileFind = /^; File\s+(.*)$/;

21
lib/compile.js

@ -38,7 +38,7 @@ temp.track();
function periodicCleanup() {
temp.cleanup(function (err, stats) {
if (err) console.log("Error cleaning directories: ", err);
if (stats) console.log("Directory cleanup stats:", stats);
// if (stats) console.log("Directory cleanup stats:", stats);
});
}
var gccProps = null;
@ -227,6 +227,11 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
return Promise.reject("Bad compiler " + compiler);
}
// Don't run binary for unsupported compiles, even if we're asked.
if (filters.binary && !compilerInfo.supportsBinary) {
delete filters.binary;
}
var key = compiler + " | " + source + " | " + options + " | " + JSON.stringify(filters);
var cached = self.cache.get(key);
if (cached) {
@ -251,7 +256,10 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
var compileToAsmPromise = tempFileAndDirPromise.then(function (info) {
var inputFilename = info.inputFilename;
var dirPath = info.dirPath;
var postProcess = compilerProps("postProcess");
var postProcess = [compilerProps("postProcess"), compilerInfo.postProcess];
postProcess = postProcess.filter(function (x) {
return x;
});
var outputFilename = path.join(dirPath, 'output.S');
if (compilerInfo.options) {
options = options.concat(compilerInfo.options.split(" "));
@ -299,9 +307,9 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
result.asm = "<No output: generated assembly was too large (" + stat.size + " > " + maxSize + " bytes)>";
return result;
}
if (postProcess) {
if (postProcess.length) {
return new Promise(function (resolve) {
child_process.exec('cat "' + outputFilename + '" | ' + postProcess,
child_process.exec('cat "' + outputFilename + '" | ' + postProcess.join(" | "),
{maxBuffer: maxSize},
function (err, data) {
if (err)
@ -333,6 +341,8 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
result.asm = asm.processAsm(result.asm, filters);
self.cache.set(key, result);
self.cacheStats();
} else {
result.asm = {text: result.asm};
}
return result;
});
@ -389,7 +399,8 @@ function CompileHandler() {
return;
}
var source = req.body.source;
if (source === undefined || typeof(req.body.options) !== "string") {
var options = req.body.options || '';
if (source === undefined) {
return next(new Error("Bad request"));
}
var options = req.body.options.split(' ').filter(identity);

235
lib/diff.js

@ -0,0 +1,235 @@
var fs = require('fs'),
child_process = require('child_process'),
temp = require('temp'),
path = require('path'),
Promise = require('promise');
function cleanAndGetIndexes(text) {
var addRules = {
name: "add",
openTag: "{+",
replaceOpenTag: "",
closeTag: "+}",
replaceCloseTag: ""
};
var delRules = {
name: "del",
openTag: "[-",
replaceOpenTag: "",
closeTag: "-]",
replaceCloseTag: ""
};
var rules = [addRules, delRules];
var TagTypeEnum = {
OPENING: 1,
CLOSING: 2
};
function tagLookup(rules, text, pos) {
var seen = false;
var type = null;
var rule = null;
for (var i = 0; i < rules.length; i++) {
var candidateTag = text.slice(pos, pos + rules[i].openTag.length);
if (rules[i].openTag == candidateTag) {
seen = true;
type = TagTypeEnum.OPENING;
rule = i;
break;
}
candidateTag = text.slice(pos, pos + rules[i].closeTag.length);
if (rules[i].closeTag == candidateTag) {
seen = true;
type = TagTypeEnum.CLOSING;
rule = i;
break;
}
}
return {
seen: seen,
rule: rule,
type: type
};
}
var finalText = "";
var posInFinalText = 0; // character that is going to be treated
// The position in the original text:
var posInText = 0; // character that is going to be treated
var StateEnum = {
OUTSIDE_TAG: 1,
INSIDE_TAG: 2
};
var state = StateEnum.OUTSIDE_TAG;
var zones = [[], []];
var currentTextBeginPos = 0;
var currentTextEndPos = null;
var currentTagBeginPos = null;
var currentTagEndPos = null;
var currentTag = null;
function forward() {
posInFinalText = posInFinalText + 1;
posInText = posInText + 1;
}
function seenOpeningTag() {