Commit Graph
27 Commits
Author SHA1 Message Date
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
Iain BuclawandPatrick Quist 3a9da38e77 Recognize weak labels if a global isn't found (#2000)
Fixes #1989

Co-authored-by: Patrick Quist <partouf@gmail.com>
2020-06-08 12:10:29 +02:00
Iain BuclawandPatrick Quist ce0b7be667 Recognize globals emitted for the mcore and rx targets (#1999)
* Recognize globals emitted for the Motorola M*CORE target

* Recognize globals emitted for the Renesas RX target

Co-authored-by: Patrick Quist <partouf@gmail.com>
2020-06-08 12:09:39 +02:00
Iain Buclaw 1f720f3a2f Fix asm parser to recognize SPARC function definitions (#1998)
Refs #1989
2020-06-08 12:06:40 +02:00
RabsRincon 6ebefff9b3 Fixes Sentry issue COMPILER-EXPLORER-5W1
Applies formatting to asm-parser.js file too
2020-01-08 10:48:17 +01:00
Márton Csordás 6f6c0dbeb2 Fix review comments of the Jump to label feature
- Use `const` where it is possible.
- Move regexes into variables and give them a name.
- Eliminate `lineNumber` variable and use the length of the asm array.
- Use `updateDecorations()` function to decorate label usages.
- Update and fix test cases.
2019-12-04 20:56:21 +01:00
Márton Csordás c1d074d6d5 Parse assembly labels on the serve-side
Parsing the labels on the server-side is more general, more flexible
and it can be easily tested.

- Store label definitions in a map. The key will be the label name and
the value will be the line number where the label definition can be
found.
- For each line get the labels which are used in the given line and
remove labels which do not have a definition.
- Modify the return value of the `processBinaryAsm` and `process`
function to return with the label definition too.
- Demangle the label usages and the label definitions too.
2019-12-01 21:36:21 +01:00
Marc Poulhiès 10cd506b86 Handle K1 MPPA VLIW bundles in assembly
K1 MPPA uses ;; as a bundle separator (same syntax as IA64,
if it gets added to CE someday...).
The bundle separator must be alone on the line, see for example:

```
        ld $r6 = 16[$r20]
        addx8d $r9 = $r2, $r5
        addw $r10 = $r2, -1
        ;;
        addd $r0 = $r6, $r9
        addd $r17 = $r10, 1
        cb.wlez $r2? .L3
        ;;
        copyd $r15 = $r0
        ;;
        maddd $r15 = $r17, -8
        ;;
```

Single ; or ;; followed by any non whitespace before eol still
considered a comment.
2019-11-21 21:08:24 +01:00
Dmitry Gerasimov d09a0ace40 Fix path handling for clang-style file directive
E.g. for such directive

    .file   1 "/home/user" "example.c"

now will be constructed valid path:

    '/home/user/example.c'

instead of this broken path:

    '/home/user/ "example.c"'
2019-11-14 01:47:20 +03:00
Matt Godbolt 57e2bae56c Bump the number of lines in a disassembly. This is a decent-sized bump up but still is not so much to destroy a web browser. Improves the specific case in #260 2019-10-26 12:47:59 -05:00
Partouf f14746b36a bugfix replace single line /*comments*/ 2019-10-25 17:19:53 +02:00
Ben Barsdell 1983e4ad41 Add basic support for CUDA native SASS assembly
- Enables "Compile to binary and disassemble the output" for CUDA source.
- Parses labels, line numbers, opcodes and disassembly.
- Fixes #946
2019-09-15 14:48:16 -07:00
Partouf 9b89389f34 fixes #1285 2019-04-30 21:05:48 +02:00
Matt Godbolt eb0a45d71f * Add 6502 support
Kills consecutive blank lines in asm output. Handles labels and
opcodes on the same line. Adds cc65 compiler support.

See #82
2019-03-31 11:45:51 -05:00
Matt Godbolt 2e7fc5fe80 Super minor tweaks to @bugwelle's awesome PR for LLVM IR mode! 2019-03-21 21:28:43 -05:00
Matt Godbolt b87322568e Merge branch 'master' into llvm 2019-03-21 20:31:42 -05:00
Sebastian Staffa 0da2ad1221 fix #dfc3b32 2019-03-03 13:54:21 +01:00
Partouf 18bf4cf6f8 fix #1229 2018-12-20 16:21:00 +01:00
Partouf f7ff8835ab remove labels that belong to libraries, added tests 2018-12-18 00:06:57 +01:00
Andre Meyering 8563b21522 [ASM Parser] Fix tests (add "filterAsmLine")
- was removed by previous commit which was rebased
2018-11-28 14:29:10 +01:00
Partouf 4baea3178b dont just filter labels 2018-11-18 17:19:29 +01:00
Partouf eb4e744853 support more c++ compilers 2018-11-18 16:34:00 +01:00
Matt Godbolt ad7f192951 Treat groups of labels next to each other as equivalent for the purposes of determining live/deadness. Fixes #1179 2018-11-17 12:58:59 -06:00
Partouf b691b3f52e support for binary mode on VS compilers 2018-11-08 16:52:31 +01:00
Matt Godbolt eabe33c166 Minor refactoring to extract filterAsmLine in one place. Starting to think about fixing #883 2018-10-22 23:00:28 -05:00
Matt Godbolt 8a43d59504 Treat xword as a data directive. Fixes #1081 2018-09-23 08:14:08 -05:00
Nicole Mazzuca 9ddf22f090 Support Visual C++ and Windows well
This commit adds support for hosting on windows, as well as better
support for the Visual C++ compiler. Specific interesting changes are:

  - switch from /FAsc to /FA
  - order functions in file order
  - support demangling win32-style identifiers with undname
  - clang++ and vc++ on win32 host are both supported
2018-07-28 15:18:43 -07:00