blob: 5b6958e18358e02d79a82bdf22956e3109792dc5 [file] [log] [blame] [raw]
<!DOCTYPE html>
<html lang="en">
<head>
<title>Compiler Explorer</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="ext/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="ext/codemirror/codemirror.css" rel="stylesheet">
<link href="gcc.css" rel="stylesheet">
<script src="client-options.js"></script>
<script src="ext/codemirror/codemirror.js"></script>
<script src="asm-mode.js"></script>
<script src="ext/jquery/jquery-2.2.2.min.js"></script>
<script src="ext/rison.js"></script>
<script src="ext/clipboard.min.js"></script>
<script src="compiler.js"></script>
<script src="gcc.js"></script>
<script src="ext/bootstrap/js/bootstrap.min.js"></script>
<script src="ext/lz-string/lz-string-1.3.3-min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', OPTIONS.google_analytics_account]);
_gaq.push(['_trackPageview']);
setTimeout(function () {
"use strict";
function create_script_element(id, url) {
var el = document.createElement('script');
el.type = 'text/javascript';
el.async = true;
el.id = id;
el.src = url;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(el, s);
}
create_script_element('urlshortener', 'urlshorten-' + OPTIONS.urlshortener + ".js");
if (OPTIONS.google_analytics_enabled)
create_script_element('ga', ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
if (OPTIONS.sharing_enabled) {
create_script_element('gp', 'https://apis.google.com/js/plusone.js');
create_script_element('twitter-wjs', '//platform.twitter.com/widgets.js');
(function (document, script, id) {
var js, r = document.getElementsByTagName(script)[0], protocol = /^http:/.test(document.location) ? 'http' : 'https';
if (!document.getElementById(id)) {
js = document.createElement(script);
js.id = id;
js.src = protocol + '://widgets.changetip.com/public/js/widgets.js';
r.parentNode.insertBefore(js, r)
}
}(document, 'script', 'changetip_w_0'));
(function(document, i) {
var f,s=document.getElementById(i);
f=document.createElement('iframe');
f.src='//api.flattr.com/button/view/?uid=mattgodbolt&button=compact&url='+encodeURIComponent(document.URL);
f.title='Flattr';
f.height=20;
f.width=110;
f.style.borderWidth=0;
s.appendChild(f);
}(document, 'flattr_button'));
}
}, 0);
</script>
</head>
<body>
<div class="navbar-nav navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Compiler Explorer - <span class="language-name"></span></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-left">
<li class="navbar-text" id="changetip_tipme_button" data-bid="MzRgCSeSnVWvAP9SVRoYFC"
data-uid="Qy46jQ356qex2GD2JGaHaK"
style=""></li>
<li class="navbar-text" id="flattr_button"></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="share" data-toggle="dropdown">Share<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="social">
<g:plusone annotation="inline" width="150"></g:plusone>
</li>
<li class="social"><a href="https://twitter.com/share" class="twitter-share-button"
data-via="mattgodbolt">Tweet</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://plus.google.com/112384289668860490877" rel="publisher">Google+ page</a>
</li>
<li><a href="https://plus.google.com/105166465490735292917" rel="author">About Matt</a></li>
<li><a href="mailto:matt@godbolt.org">Contact Matt</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<section id="main" class="container-fluid">
<div class="row">
<div class="col-md-5">
<form class="well form-inline files">
<div>
<label>Source: <select class="source"></select></label>
<label>Name: <select class="filename"></select></label>
</div>
<div class="btn-group btn-group-sm">
<button class="btn btn-sm load">Load</button>
<button class="btn btn-sm save">Save</button>
<button class="btn btn-sm saveas">Save as...</button>
<button class="btn btn-sm fulllink" title="Permanent, full URL to this page">Full link</button>
<button class="btn btn-sm shortlink" title="Permanent link to this page as a short link">Short link</button>
</div>
<div class="collapse permalink-collapse">
<div class="input-group input-group-sm permalink">
<input type="text" class="form-control input-sm" placeholder="Loading" readonly id="permalink" size="1024">
<span class="input-group-btn">
<button class="btn btn-sm btn-default clippy" type="button" data-clipboard-target="#permalink"
title="Copy to clipboard">
<img src="ext/clippy.svg" class="clippy" width="13px" alt="Copy to clipboard">
</button>
</span>
</div>
</div>
</form>
</div>
<div class="col-md-7">
<form class="well form-inline">
<table>
<tbody>
<tr>
<td class="dropdown compilers-container">
<button accesskey="c" type="button" title="Compiler to use (alt-C)" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<span class="compiler">g++</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu compilers">
</ul>
</td>
<td>
<input accesskey="o" title="Options to pass to compiler (alt-O)" class="compiler_options" placeholder="compiler options" type="text" value="" size="256">
</td>
</tr>
</tbody>
</table>
<div class="btn-group btn-group-sm filter">
<button class="btn btn-sm" type="button" value="binary"
title="Compile to binary and disassemble the output">Binary
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Filter unused labels from the output" value="labels">Unused labels
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Filter all assembler directives from the output" value="directives">Directives
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Remove all lines which are only comments from the output" value="commentOnly">
Comment-only
lines
</button>
<button class="btn btn-sm" type="button" title="Output disassembly in Intel syntax"
value="intel">Intel syntax
</button>
<button class="btn btn-sm" type="button"
title="Colourise lines so one can see how the source maps to the output"
value="colouriseAsm">Colourise
</button>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-6 editor">
<div class="topbar indented">
Code editor
<span class="pull-right input-group input-group-sm">
<button accesskey="a" title="Automatically build when you stop typing"
class="btn btn-default btn-sm autocompile active">
<span class="glyphicon glyphicon-play-circle"></span>
</button>
</span>
</div>
<textarea>// Type your code here, or load an example.</textarea>
</div>
<div class="col-md-6 asm">
<div class="topbar indented">Assembly output</div>
<textarea>Awaiting</textarea>
</div>
</div>
<div class="row result">
<div class="topbar">Compiler output &mdash; <span class="compilerVersion"></span></div>
<div class="output">
<div class="template"></div>
</div>
</div>
</section>
<div class="modal fade" id="saveDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4>Save as...</h4>
</div>
<div class="modal-body">
<label>Filename: <input class="save-filename" style="width: 30em;" type="text"></label>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn btn-default">Cancel</a>
<a href="#" class="btn btn-primary save">Save</a>
</div>
</div>
</div>
</div>
<div class="template lang c">// Type your code here, or load an example.
int square(int num) {
return num * num;
}
</div>
<div class="template lang rust">// Type your code here, or load an example.
pub fn square(num: i32) -&gt; i32 {
num * num
}
</div>
<div class="template lang go">// Type your code here, or load an example.
// Your function name should start with a capital letter.
package main
func Square(x int) int {
return x * x
}
func main() {}
</div>
<div class="template lang d">// Type your code here, or load an example.</div>
<map name="ghm">
<area shape="poly" coords="16,0,149,133,149,0" href="https://github.com/mattgodbolt/gcc-explorer">
</map>
<script type="text/javascript">
(function () {
if (!OPTIONS.sharing_enabled)
$('#share').remove();
if (OPTIONS.github_ribbon_enabled) {
$(document.createElement('img'))
.css({
position: "absolute",
top: "40px",
right: 0,
border: 0,
width: "149px",
height: "149px"
})
.attr('src', 'http://aral.github.com/fork-me-on-github-retina-ribbons/right-green@2x.png')
.attr('alt', 'Fork me on GitHub')
.attr('useMap', '#ghm')
.appendTo(document.body)
}
})();
</script>
</body>
</html>