Commit Graph
465 Commits
Author SHA1 Message Date
Patrick Quist b744d6ad9e Asm-parser binary bugfix (#2904)
* unittests

* extra label definition screws up logic

* fix test
2021-08-31 14:07:23 +02:00
partouf 9d382eb03e bugfix mainsource detection 2021-08-29 13:11:15 +00:00
Rubén Rincón Blanco b87f8569e3 Make linter happy 2021-08-28 20:10:51 +02:00
RabsRincon d562ae0376 Add test for forcedVersion flag 2021-08-28 19:28:03 +02:00
RabsRincon 854fdf7127 Some more semver tests 2021-08-28 02:43:44 +02:00
RabsRincon 0b75857df3 Only focus on the first word of semver for ordering
Helps with #2860
2021-08-28 02:40:05 +02:00
Patrick Quist 5e5e60159a Multifile/IDE mode (#2725) 2021-08-26 21:57:07 +02:00
Mats LarsenandMatt Godbolt 53b9e0ac59 Support multiple formatter types for /api/format (#2818)
* Make /api/format handle multiple formatter types
* Ignore preferred style if the formatter is a 'one true style' formatter
* Add tests for base formatter
* Document /api/formats and /api/format/<formatter> usage
* Document adding a new formatter
* Update amazon config

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2021-08-24 18:46:38 -05:00
Mats Larsen b6c2380c56 Assembly API documentation for Java Bytecode (#2817)
* Add assembly documentation endpoint for Java bytecode
* Upstream asm docenizer for Java
* Remove jvms.html from gitattributes as it is never checked into vcs
* EOF line for docenizer-java.js
* Use find-node to locate nodejs
* Format code according to style guide
2021-08-14 12:56:33 -05:00
ca017bac31 Add support for heterogeneous compute (#2836)
* Extract device code from assembly files.

This commit by itself does not actually add any viewing panes for the
extracted device code, nor does it provide any means to provide
device-specific postprocessing steps.

* Add a rudimentary device view.

This doesn't handle multiple device outputs correctly at the moment, and
it provides no opportunity to view device code differently from
non-device code for now.

* Lint issues

* Some more WIP getting it working.

* Add device extraction code

* More fixes, and keep state

Co-authored-by: Joshua Cranmer <joshua.cranmer@intel.com>
Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-08-14 12:53:22 -05:00
RabsRincon 565a4f7b48 Actually fix Windows options-handler tests for realsies now 2021-08-13 06:11:32 +02:00
RabsRincon 2607bf580a Fix options-handler tools tests in Windows 2021-08-13 06:03:53 +02:00
RabsRincon 6fd069b35c Fix utils-test.js eslint complaints 2021-08-13 05:31:10 +02:00
RabsRincon 39aac5341b Add basic options-handler tools parse test 2021-08-11 08:54:27 +02:00
RabsRincon 383c540ad8 Add missing tests for utils.fileExists 2021-08-11 08:19:54 +02:00
Rubén Rincón Blanco 387c75a1d7 Adds configs for nsjail cfg and firejail profile paths (#2846)
* Adds configs for nsjail cfg and firejail profile paths

As suggested by @apmorton

Issue #2845

* Add & improve exec tests with new config changes

* Remove stub. Exports are inmutable so no replacing the internal calls

* Resort back to calling the mapping function in the tests too

* But don't call it in the one function that is testing it

* Expand reach of .local gitignore

* Address @apmorton PR review

The tests are now a mess, so I won't merge,
 just in case I get shown how to do it properly
2021-08-11 06:38:04 +02:00
RabsRincon a66df0bf31 Bump timeout value of filters tests 2021-08-10 10:41:30 +02:00
Matt Godbolt 25f48a89a0 Reassign my copyright to Compiler Explorer Authors 2021-07-24 08:46:18 -05:00
RabsRincon db6626e3e8 Reassign my copyright to Compiler Explorer Authors 2021-07-24 00:51:34 +02:00
Matt GodboltandRabsRincon d52a1318f8 Treat data definitions in the middle of functions as "strong" (#2792)
* Treat data definitions in the middle of functions as "strong"

Things like ARM jump tables put important data inline within a function. Such
data should be treated as a "strong" reference (e.g. a root use). For example:

```
        sub     r3, r0, #65
        cmp     r3, #19
        ldrls   pc, [pc, r3, asl #2]
        b       .L7
        .word   .L8
        .word   .L7
        .word   .L6
        .word   .L7
        ....etc...
.L7: some things
.L8: some other things
```

Without this change, the `.L8` label would be dropped as unused. But it's implicitly used
by the sequence of `.word`s in the middle of the function.

Closes #2788

* Keep curly bracket style of existing if-else block

Co-authored-by: RabsRincon <ruben@rinconblanco.es>
2021-07-22 14:12:54 -05:00
Mats Larsen 0693def6b4 Re-enable tests for JavaCompiler (#2797)
Now that Java is running on CE again, it'd make sense to re-enable these tests. This patch also includes a fix for the javap parsing test.

The local compilation environment variable was never set, causing env to be undefined inside testJava
2021-07-22 07:29:05 -05:00
Artem Belevich 115cbf3817 Add support for HIP compilation for AMD GPUs. (#2759)
* Added support for HIP compilation for AMD GPUs.

At the moment it only supports stand-alone compilation w/o ROCm SDK.

* Enable barebones HIP compilation.

Clang by itself is good enough to compile simple kernels that do not need ROCm
SDK headers and bitcode libraries.

Closes #2760
2021-07-19 21:55:23 -05:00
Rubén Rincón Blanco f3acbc972a Adds .hidden for libraries (#2780)
* Adds .hidden for libraries
* Add test for new hidden property
2021-07-19 21:53:54 -05:00
Marc Poulhiès 5fe6f140a5 Better handling of Kalray MPPA comment and bundle separator (#2768)
The KVX assembly uses ;; as the bundle separator, which can be a problem to
parse as ; is also commonly used as a comment marker.

Latest compiler version also adds cycle information for opt level >= 1, which
confuses the current comment filter that treats the bundle separator as comment.

Tune the regex to treat the following :

        addd $r12 = $r12, -96
        get $r16 = $ra
        ;;      # (end cycle 0)

as non-comment. The ';;  #' is special-cased as non-comment.
2021-07-08 16:45:15 +02:00
Rubén Rincón Blanco 27012bb0ec Initial sketch for how we could parse Rust output (#2761)
* Initial sketch for how we could parse Rust output

It has many issues, which I need to ask about, but ey, it works!

* Fix spacing

* Add tests for the new Rust output parsing
2021-07-06 05:21:31 +02:00
Patrick Quist d6083eadf7 Limit AWS SSM request to what we actually use (#2750)
* test

* use different call

* fixes to call and unittest
2021-06-30 07:09:19 +02:00
Patrick Quist cb76eb5f11 undo 2021-06-30 06:20:41 +02:00
Patrick Quist 69474509d3 fix mock 2021-06-30 06:17:41 +02:00
Matt Godbolt a6eef13562 Support an executionWrapper per compiler. CC @jfalcou 2021-06-27 17:09:30 -05:00
b4ebb47ac2 Add Kotlin/JVM support (#2637)
* Add Kotlin/JVM support

* Update CONTRIBUTORS.md

* Use kotlinc-jvm instead of kotlinc

* Fix alphabetical ordering

* Filter kotlin compiler arguments

Extract user options filtering for java into a separate function to
handle filtering options with extra arguments.
Filter kotlin compiler options: -d, -jdk-home, -kotlin-home, -script, -progressive

* Filter -Xjavac user options

Filter any option that starts with '-Xjavac', as it could be used to pass unwanted options through kotlinc to javac.

* Fix year in copyright

Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>

* Add kotlin.amazon.properties

* Add JAVA_HOME to kotlin default exec options

Query per-compiler property 'java_home' and set environment

* Add java_home to kotlin properties

Co-authored-by: Daniel Below <daniel.below@jetbrains.com>
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2021-06-02 22:58:41 +02:00
Matt Godbolt a4edf7ed6b No array for each 2021-05-28 18:08:05 -05:00
Matt Godbolt cb50486d27 Bump eslint dependencies and suppress most of the warnings 2021-05-27 23:06:42 -05:00
Matt Godbolt 0aa3c9e4b2 Comment out ambiguous mangled name
Currently this test relies on the system-installed c++filt.
The newer binutils (2.36.1) has a fix which changes one of the
symbols' demanglings. For now, just disable the troublesome line.

New binutils:
```
$ c++filt _ZSt8__equal4IPKcS1_ZNSt8__detail16_Backref_matcherIS1_NSt7__cxx1112regex_traitsIcEEE8_M_applyES1_S1_S1_S1_EUlccE_EbT_S9_T0_SA_T1_
bool std::__equal4<char const*, char const*, std::__detail::_Backref_matcher<char const*, std::__cxx11::regex_traits<char> >::_M_apply(char const*, char const*, char const*, char const*)::{lambda(char, char)#1}>(char const*, char const*, char const*, char const*, std::__detail::_Backref_matcher<char const*, std::__cxx11::regex_traits<char> >::_M_apply(char const*, char const*, char const*, char const*)::{lambda(char, char)#1})
```

Old binutils:
```
$ c++filt _ZSt8__equal4IPKcS1_ZNSt8__detail16_Backref_matcherIS1_NSt7__cxx1112regex_traitsIcEEE8_M_applyES1_S1_S1_S1_EUlccE_EbT_S9_T0_SA_T1_
bool std::__equal4<char const*, char const*, std::__detail::_Backref_matcher<char const*, std::__cxx11::regex_traits<char> >::_M_apply(char const*, char const*, char const*, char const*)::{lambda(char, char)#1}>(char const*, std::__detail::_Backref_matcher<char const*, std::__cxx11::regex_traits<char> >::_M_apply(char const*, char const*, char const*, char const*)::{lambda(char, char)#1}, char const*, char const*, std::__detail::_Backref_matcher<char const*, std::__cxx11::regex_traits<char> >::_M_apply(char const*, char const*, char const*, char const*)::{lambda(char, char)#1})
```
2021-05-23 13:40:51 -05:00
Patrick Quist ba6da76ffc add wrap to executor (#2679) 2021-05-21 20:40:44 +02:00
Arseniy Zaostrovnykh 9b94ce7bab Fix #1346: truncating nested top-level declarations (#2626) 2021-04-27 11:32:47 -05:00
Matt Godbolt b934d999d9 Keep go asm in UPPERCASE. See #2620 2021-04-26 18:34:16 -05:00
Arseniy Zaostrovnykh 4f88b3f4ec Highlight ASM and LLVM IR lines corresponding to the given token and vice-versa (#2594)
* Highlight the lines in LLVM-IR corresponding to specific tokens

In addition to the highlighting of all the IR lines corresponding to the given
source line (using blue background), also make the lines corresponding to the
given token on that source line.

* Parse the optional source column number in the text asm

* Bolden the asm lines corresponding to the given token and vice-versa

* Ignore column number if it is 0; add a test with no column specified
2021-04-13 10:22:44 +02:00
Matt Godbolt 259b72e16a Add some tests to s3 storage 2021-04-12 17:46:53 -05:00
Austin Morton a194b5a591 Always store shortlinks with a 6 character prefix in dynamodb 2021-04-09 20:06:06 -04:00
Austin Morton 80fa894cd0 Store shortlinks with both 6 and 9 character prefixs in dynamodb 2021-04-09 17:47:14 -04:00
Arseniy Zaostrovnykh c0633d087c Highlight individual tokens in the source file and the corresponding nodes in the LLVM AST pane (#2572)
* Enable the editor to highlight spans in the highlighted line
* Parse and send the column numbers for LLVM AST nodes
* Highlight the part of the line corresponding to a node

For nodes that fit on a single line
* Highlight the nodes directly corresponding to symbol hovered over

Also highlight entire tokens in the source, not just their first character

* Fix the squiggly underline for string literals
2021-04-06 14:59:46 -05:00
d461b8c43c Add support for nsjail compiler executions (#2569)
* Add support for nsjail compiler executions
* Enable nsjail for beta

Co-authored-by: partouf <partouf@gmail.com>
Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2021-04-06 14:52:16 -05:00
Matt Godbolt 71e23aee6e Treat LLVM %blah = expressions as "opcodes"
Fixes #957
2021-04-01 15:37:16 -05:00
Matt Godbolt f7f0953167 ANSI colour fixes.
* Rephrases a regex with a suggestion from @cpplearner to prevent
  catastrophic backtracking.
* Cherry picks in some things from https://github.com/rburns/ansi-to-html/pull/84
  to support 256-colour better.
* Adds some very simple tests.

Fixes #1666.
Fixes #2315
2021-04-01 14:24:05 -05:00
Jessica Clarke af686e81f7 Support ELF Tool Chain and LLVM objdump (#2538)
* Remove redundant implementations of objdump function

* Add support for ELF Tool Chain and LLVM objdump

Only binutils supports --insn-width and LLVM uses --x86-asm-syntax=intel
rather than -M intel. The default remains binutils.
2021-04-01 08:34:07 -05:00
Matt Godboltandpartouf 657866b86c Approval tests (#2491)
* Approval tests

Move to approvals to do the approval-style tests we had in filters-cases.

You can configure which diff viewer it uses with ~/.approvalsConfig

Pros:
* standard diff-based thing
* easy to "bless" all the differences (see `forceApproveAll`)
* fairly standard pattern
* forces a comprehensive all permutations and combinations vs
  the ad hoc subset we picked before
Cons:
* really wants to name the files *.approved.txt
* spawns _all the diffs_ at once and so an overarching change
  can crush your computer with diff (e.g. if you use `meld` like
  I do, you end up with 100+ diffs opening)
* comprehensive testing means this takes longer, now ~16s to do
  all these tests

* use latest approvals and its new settings

* Normalize line endings in the hope of getting windows passing

* fix for windows

* oops

Co-authored-by: partouf <partouf@gmail.com>
2021-03-28 22:57:40 +02:00
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