Refactors the handler for the AsmDocs API to reduce code duplication.
**Breaking changes proposed**
- API will now return 404. This used to return 200 with "Unknown opcode" which is what led to issue #3117. Following cases has been changed:
1. archiecture was not found
2. instruction opcode was not found
- API will now return 406 not acceptable when the accepted content type is not text or json
- There is no longer a `result` field on a 200 request, instead the assembly documentation object is returned.
- There is no longer a `found` field on any request, the HTTP codes indicate whether it was found or not (200 means found)
**New features**
- The frontend will only request the opcode for an instruction set at most once, caching every single outgoing request.
- The "There was an error fetching the documentation for this opcode" has been adjusted to contain what went wrong.
Relevant tests have been added and updated.
* Await for things
We had a number of things that aren't await()ing their promises.
That led to non-deterministic compiler settings like Intel support.
I used the IDE to find them all and fix the ones that I thought looked
important.
More generally we should use tslint (once we're all typescript) to
ensure this more generally. I tried the eslint equivalent but it
either overreacted or didn't catch anything.
Closes#3085
Site settings for tab width and tabs vs spaces are now being used when sent to the /api/format APIs.
This patch also includes some tiny internal refactoring on the bits related to the formatting API.
* lintfix
* dont look at user agent to escape things
* Clean my old code a tad
* Fix lint error
* some more metadata options and tests for it
* refactor underscore calls
Co-authored-by: RabsRincon <ruben@rinconblanco.es>
* Changes to allow Program (vs Unit) in Object Pascal
* add possibility of dpr
* more flexibility with pascal filenames
* lintfixes
* i have no idea what im doing
* apply changes to pascal-win
* pascal fixes
* pascal projectfile changes
* work in progress
* bugfixes
* bla
* bugfixes
* mostly working
Co-authored-by: paul mcgee <paul.mcgee.8@bigpond.com>
Co-authored-by: Paul McGee <paulmcgee1969@gmail.com>
* 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>
* 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
* 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>
* 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
* 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>
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
* 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
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.
* 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