Commit Graph
419 Commits
Author SHA1 Message Date
Patrick Quist c0a45e754c Add CMake API (#2509)
And multifile support. No UI support.
2021-03-22 22:59:03 +01:00
partouf f227c75f5b bugfix arch detection 2021-03-22 20:24:51 +00:00
Arseniy ZaostrovnykhandArseniy Zaostrovnykh 23b152b298 Colorize the LLVM AST to match the colors of the source (#2511)
Colour the AST view with the same colors as the source code

* Add a couple of trivial test cases for processAstOutput
* Fix the processAstOutput test, ad a test for a file with #include
* Send individual lines for the AST output
* Parse the source lines for AST
* Register as a contributor
* Factor out the LlvmAstParser into a separate file

Co-authored-by: Arseniy Zaostrovnykh <arseniy.zaostrovnykh@sonarsource.com>
2021-03-22 13:21:08 -05:00
Matt Godbolt 6fcf5d758f Increase the number of characters in s3 URLs
We used to use 6. This gives 32^6 possible URLs.
As we increase the number of URLs the godbolt.org site
stores, the chance of an attacker being able to guess
existing URLs has increased. To stay one step ahead,
we bump to 9 characetrs here: 32^9 possible is 35 trillion
possibilities.
2021-03-21 15:06:53 -05:00
Rubén Rincón Blancoandpartouf 7f4c4a9ebf Report back an estimate of filtered lines (#2506)
* Report back an estimate of filtered lines

The commit is tested, but I had to remove an eslint check and
 not run the filter tests because I forgot how to bless them.

* Implement proposed wording change

* Add filtered report in compile info label

* Simplify and add reporting to binary mode filter

* Fix bad git stash shenanigans

* ignore filteredCount when testing

* filteredCount is not guaranteed to be returned

* extra check

Co-authored-by: partouf <partouf@gmail.com>
2021-03-20 20:17:38 +01:00
Patrick Quist 8e2de4b887 Let api compile also detect aliased compilers (#2502)
* initial implementation to look for aliases correctly and test

* refactoring

* lintfix
2021-03-19 12:04:29 +01:00
Jeremy Overesch 11e470a8f7 Feature/jo/arm dockenizer (#2463)
* Update docenizer to python3
* Remove unused code in docenizer
* Create new asm-docs-arm and asm-docs-api-arm files for parsing and retrieving arm related opcodes.  Add conditional instruction switch.
* Rename docs files to specify instruction set
* Add arm32 at /api/asm/arm32/:opcode
* Add @jovere to contributor list
* Add `instructionSet` compiler option
* Update client to access correct instruction based on the `instructionSet` option
* Add `arm32` `instructionSet` option for ARM C++ compilers
* Add `arm32` instructionSet to obvious places in C/C++
2021-03-12 07:40:49 -06:00
Matt Godbolt bb0a747392 Ensure chai.should is in scope for all tests 2021-03-11 20:40:50 -06:00
Patrick Quist 7edd6d40ac Time all the things (#2462)
* time executeDirect in ms

* measure library download and extract time

* time package download

* download timings when using execution checkbox

* proof of concept timing graph implementation

* use vertical bars for graph

* add objdump time

* add timing for asm parsing

* add timing graph to execution pane as well

* download timings on execution pane

* things
2021-03-11 17:37:57 +01:00
Patrick Quist 6ef5a9c628 fix #2231 (#2478) 2021-03-11 17:30:25 +01:00
Patrick Quist 29236dd92c Attempt at refactoring to better separate ldpaths and libpaths (#2452)
* attempt at refactoring to better separate ldpaths and libpaths

* fix doc

* fix doc

* bugfix win32 libpaths

* add ldPath to getVersion query environment
2021-03-05 22:40:18 +01:00
Partouf 56e64c1faf fix compiler.options splitting 2021-03-04 22:08:42 +01:00
Partouf 3a26b78161 fix tests on windows 2021-03-04 21:28:04 +01:00
Rubén Rincón BlancoandPatrick Quist 1642130a55 Add support for more cases of verbose demangling (#2446)
* Add support for more cases of verbose demangling

I skipped the tests on this commit so that I could push it,
 and add the tests at a later date.

I do this because I'm not sure this does not break unreleated
 stuff so I wanted to make the changes visible before fixing the tests

* Adress review comments

* Update cpp.js

* new test results

Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-02-25 21:38:51 +01:00
Matt Godbolt 17b2bb8a58 Move /shortener to /api/shortener (#2426)
We still support /shortener (though will scrape logs to see when
we can remove).

The route under /api/shortener will have the CORS headers set up
properly for things like @foonathan's lexy visualiser.
2021-02-15 12:52:46 -06:00
Matt Godboltandpartouf a9d76dd0df Demangle optimization (#2390)
Uses a prefix tree to find replacements in each
line, instead of looping over all replacements for all lines.
Adds a large test (which was part of bug 1336). On my machine it
used to take 45s to process that test, now it takes ~1.5s.

Skip demangle replacement entirely if there's no demangling to be done. CC @apmorton

Co-authored-by: partouf <partouf@gmail.com>
2021-01-18 11:33:19 -06:00
Matt Godbolt 5a59cbacfa Tweaks to mocha setup to let IDE users run individual tests again 2021-01-16 09:58:31 -06:00
Patrick Quist 4737c7c11a support .d2line (#2375) 2021-01-07 14:16:34 +01:00
Matt Godbolt 88d8505cca Count compilations and executions in prom 2020-12-07 22:57:03 -06:00
Sam Elliott 068f62cdd8 [riscv] Enable More RISC-V Targets (#2326)
RISC-V became a default backend in Clang 9.0. This commit enables the
use of the RISC-V backend for Clang in versions:
- 9.0.0
- 10.0.0
- 10.0.1
- 11.0.0

I also did a few other tidy-ups:
- I ensured that these could use more headers for rv64, by adding the
  `--gcc-toolchain` and `--sysroot` args to point to the rv64 8.2.0
  cross-compiled gcc toolchain.
- I updated the `-mabi` for rv64gc so it matches what that toolchain is
  likely to have chosen as a default (and what a user is likely to
  expect with the gc extension). I should check this, but I'm not sure
  how I can.
- I updated the `-mabi` for rv32gc so it matches what a user is likely
  to choose by default (ilp32d).
- I changed the config keys to introduce a hyphen, to match the arm
  compiler keys (and added the right alias).
- I'm not sure if older versions of CE-built clang also have RISC-V,
  given that the clang-builder repo has `RISCV` in the experimental
  targets to build. (PR incoming to remove that, as it's no longer
  needed).

I haven't been able to test this, partially because it depends on the
exact compiler-explorer setup on amazon, but I gleaned these details
from code in the compiler-explorer/infra repository.

Signed-off-by: Sam Elliott <sam@lenary.co.uk>
2020-11-13 07:30:52 -06:00
partouf 8a9db85256 unittest not really realistic anymore, demangling is not done in parser 2020-10-22 21:10:34 +00:00
Matt Godbolt 17c8ab8f46 Add stats for caches (#2300) 2020-10-20 14:51:31 -04:00
partouf 924dd0219d add initial unicode asm test 2020-10-06 05:56:22 +00:00
partouf 9b51556017 remove obsolete links prop in asm json 2020-10-05 23:24:00 +00:00
partouf 28f0137f09 add some basic binary objdump parsing testcases 2020-10-05 22:40:52 +00:00
Austin Morton de85aecc7d Normalize and enforce license disclaimer headers (#2234) 2020-09-27 00:20:19 -04:00
Patrick Quist 4a158e1ff4 Library widget revamp (#2223)
* Use new widget for the ever-expanding library count
2020-09-27 01:59:40 +02:00
Austin Morton 9dcd208879 Fix lint warning 2020-09-26 19:04:48 -04:00
Matt Godbolt f68198af9e Reassign copyright to Compiler Explorer Authors (#2233) 2020-09-26 17:50:40 -05:00
Patrick Quist a2eed58cd0 Transfer copyright to compiler explorer authors (#2232) 2020-09-26 18:26:02 -04:00
Austin Morton 044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Patrick Quist 697c8e9296 support library options to be passed on to the compiler (#2215) 2020-09-25 02:09:47 +02:00
Austin Morton 3c4aa76707 Replace demanglerClassFile with demanglerType (#2225) 2020-09-23 05:34:30 -04:00
Austin Morton dde5ef02fa Move some files in preparation for es6 modules 2020-09-23 04:30:15 -04:00
Austin Morton ca437e15b6 Consolidate eslint configuration (#2224) 2020-09-23 02:09:32 -04:00
Austin Morton 9052568afd Fix incorrect usage of Promise/async in test suite
In most cases the result was assertions simply not being run.

This was verified by changing the assertion in a way that should
have resulted in failure, and observing no tests failing.

Another case resulted in tests being registered to the wrong suite.

The common theme here is that if you are dealing with async in mocha
you must await everything or return any promise objects you create.

The simplest thing to do is convert the function to use async/await,
except in a `describe` callback where async can *not* be used.  If the
async code is not going to generate any test cases, you can make use of
`before(async () => {});`.  If you are going to dynamically generate any
test cases, you must do so synchronously within the `describe` callback.
2020-09-23 01:20:40 -04:00
Patrick Quist 356e87f202 .inst as an opcode (#2190)
* add directive exception for .inst

* unittests
2020-09-06 21:55:05 +02:00
Patrick Quist 0f01b99846 Fix curl API (#2184)
* manually parse formdata to be compatible with curl examples

* only parse formdata when /noscript/compile, add unittests

* no need to parse formdata in these cases

* use specific handling per url
2020-09-05 12:22:44 +02:00
Patrick Quist 837fc3cd00 Filter compilers in execution panel (#2181)
* basic supportsExecute filter

* dont mess up existing compiler selections

* dont execute if the compiler doesn't support it, do try to build still

* disable execute for clang arm compilers

* require at least 1 supportsExecute before default adding and selecting anything

* gcc 1.27 dont execute

* get rid of -Wl,-rpath error message
2020-09-04 21:28:14 +02:00
Patrick Quist ab2f8e209a Compilers API changes (#2170)
* dont return all compilerproperties always in /api/compilers

* fields=all ipv ?all

* use fields=all with remote instances

* add to documentation

* cover more paths with tests
2020-09-02 21:36:02 +02:00
Patrick Quist 07f83959d5 Add ptxas (#2102)
* add ptxas

* forgot to commit these

* reuse nvdisasm compatible parsing

* lintfixes
2020-08-07 18:31:38 +02:00
Rubén Rincón BlancoandAustin Morton ccff4b9ee5 Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible

In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules

This PR attempts to not change code behavior when possible.  In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the 
code base to silence the error.  You can find these by searching for `eslint-disable-next-line`.

Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2020-08-04 16:39:02 -04:00
Austin Morton fb2f43b579 Ensure sentry environment is set for node backend
fixes #2104
2020-07-27 14:11:52 -04:00
Patrick Quist cf7e0b029f [WIP] Fetch binaries for libraries before building (#1945)
* allow liblink also in lib group

* basic working version of lib binaries via conan

* refactored buildenvsetup into classes

* draft of more library readme

* things that aren't really needed

* dont request from conan if theres nothing to link

* conditionally

* its getting late

* download libraries with "native js"

* add libs

* Update c++.amazon.properties

* Update c++.amazon.properties

* Update c++.amazon.properties

* Update buildenvsetup-ceconan.js

* support library alias client- & server-side

* .

* merge master

* url change

* path fix

* disable broken compilers

* buggy clang compilers

* removed disabled compiler

* Update c++.amazon.properties

* bugfixes and add library lookupversion

* libuv and openssl update

* add libs

* test if tbb works with tbb_debug

* normal tbb

* rpath current folder as well for .so's

* add new tbb version and switch folders

* disable ulib
2020-07-15 01:33:54 +02:00
Partouf dc2361291e bugfix fortran errors 2020-07-14 20:41:21 +02:00
Rubén Rincón Blanco 1106db4939 Make url hash a base32 encode (#2062)
Avoids most of the problems present with the current base64 impl
2020-07-06 08:33:10 -04:00
RabsRincon 13ad03f3b4 Fix tests
Now speedup is negilable - async and mocha are not great partners
2020-06-23 06:50:49 +02:00
RabsRincon 727d95b4a5 Make all filter cases run again
There's still a speedup, but it's not so noticeable
2020-06-23 06:24:06 +02:00
RabsRincon 3724c6e37b Sppedup and reorganize filter tests structure 2020-06-23 05:52:36 +02:00
RabsRincon 82d89c7ad6 Add test for issue #2032
This is not too useful indeed, and it should have been there
 from the begining - SOrry it took so long to get it started!
2020-06-23 04:50:11 +02:00