summaryrefslogtreecommitdiffstats
path: root/lld/wasm/WriterUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Wrap definitions in namespace lld { namespace wasm {. NFCFangrui Song2019-10-101-65/+67
| | | | | | | | | | Similar to D68323, but for wasm. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D68759 llvm-svn: 374279
* [WebAssembly] Initialize memory in start functionThomas Lively2019-09-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: - `__wasm_init_memory` is now the WebAssembly start function instead of being called from `__wasm_call_ctors` or called directly by the runtime. - Adds a new synthetic data symbol `__wasm_init_memory_flag` that is atomically incremented from zero to one by the thread responsible for initializing memory. - All threads now unconditionally perform data.drop on all passive segments. - Removes --passive-segments and --active-segments flags and controls segment type based on --shared-memory instead. The deleted flags were only present to ameliorate the upgrade path in Emscripten. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65783 llvm-svn: 370965
* [WebAssembly] Rename except_ref type to exnrefHeejin Ahn2019-07-151-2/+2
| | | | | | | | | | | | | | | | | | | Summary: We agreed to rename `except_ref` to `exnref` for consistency with other reference types in https://github.com/WebAssembly/exception-handling/issues/79. This also renames WebAssemblyInstrExceptRef.td to WebAssemblyInstrRef.td in order to use the file for other reference types in future. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64703 llvm-svn: 366145
* [Coding style change][lld] Rename variables for non-ELF portsRui Ueyama2019-07-111-99/+99
| | | | | | | | | | | This patch does the same thing as r365595 to other subdirectories, which completes the naming style change for the entire lld directory. With this, the naming style conversion is complete for lld. Differential Revision: https://reviews.llvm.org/D64473 llvm-svn: 365730
* [wasm] Simplify. NFCFangrui Song2019-04-181-1/+1
| | | | llvm-svn: 358663
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [WebAssembly] Instruction renamingThomas Lively2019-01-081-2/+2
| | | | | | | | | | | | Summary: Associated with D56338. Reviewers: aheejin, aardappel Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56339 llvm-svn: 350610
* [WebAssembly] Add support for the event sectionHeejin Ahn2018-12-081-3/+21
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* [WebAssembly] Delete unused using statements (NFC)Heejin Ahn2018-11-211-1/+0
| | | | | | | | | | Reviewers: sbc100, dschuff Subscribers: mehdi_amini, jgravelle-google, sunfish, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D54683 llvm-svn: 347370
* [WebAssembly] Remove duplicate function. NFC.Sam Clegg2018-11-011-21/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D53963 llvm-svn: 345806
* [WebAssembly] Refactor use of signaturesDerek Schuff2018-10-031-19/+19
| | | | | | | | Update use of WebAssemblySignature to go along with D52580 Differential Revision: https://reviews.llvm.org/D52622 llvm-svn: 343734
* [WebAssembly] Add v128 value typeThomas Lively2018-09-201-0/+2
| | | | | | | | | | Reviewers: sbc100, aheejin, dschuff Subscribers: jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D52106 llvm-svn: 342690
* Support: Simplify endian stream interface. NFCI.Peter Collingbourne2018-05-181-1/+1
| | | | | | | | | | | | Provide some free functions to reduce verbosity of endian-writing a single value, and replace the endianness template parameter with a field. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47032 llvm-svn: 332757
* [lld] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-151-1/+1
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44977 llvm-svn: 332351
* [WebAssembly] Add export/import for function pointer tableNicholas Wilson2018-03-271-0/+11
| | | | | | | | | | This enables callback-style programming where the JavaScript environment can call back into the Wasm environment using a function pointer received from the module. Differential Revision: https://reviews.llvm.org/D44427 llvm-svn: 328643
* [WebAssembly] Add except_ref as a first-class typeHeejin Ahn2018-03-081-0/+2
| | | | | | | | | | | | | | Summary: Add except_ref as a first-class type, according to the [[https://github.com/WebAssembly/exception-handling/blob/master/proposals/Level-1.md | Level 1 exception handling proposal ]]. Companion to D43706. Reviewers: sbc100 Subscribers: jfb, dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43707 llvm-svn: 326986
* [WebAssembly] Run clang-format. NFCNicholas Wilson2018-03-071-1/+1
| | | | llvm-svn: 326896
* [WebAssembly] Rename global types to match the notation in the specNicholas Wilson2018-03-021-4/+2
| | | | llvm-svn: 326583
* [WebAssembly] Use uint8_t for single byte values to match the specSam Clegg2018-03-011-8/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43922 llvm-svn: 326455
* [WebAssembly] Use Twine rather than StringRef for logging messagesSam Clegg2018-03-011-8/+11
| | | | | | | | Also add missing tracing to writeU8. Differential Revision: https://reviews.llvm.org/D43919 llvm-svn: 326398
* [WebAssembly] Fix variable name.Rui Ueyama2018-02-281-1/+1
| | | | llvm-svn: 326301
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-231-0/+7
| | | | | | | | | | | | | | | | | | This change modified lld to in response the llvm change which moved to a more explicit symbol table in the object format. Based on patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41955 2. https://reviews.llvm.org/D42585 The primary difference that we see in the test output is that for relocatable (-r) output we now have symbol table which replaces exports/imports and globals. See: https://github.com/WebAssembly/tool-conventions/issues/38 Differential Revision: https://reviews.llvm.org/D43264 llvm-svn: 325861
* Consistent (non) use of empty lines in include blocksSam Clegg2018-02-201-2/+0
| | | | | | | | | The profailing style in lld seem to be to not include such empty lines. Clang-tidy/clang-format seem to handle this just fine. Differential Revision: https://reviews.llvm.org/D43528 llvm-svn: 325629
* Do not create a temporary data structure for relocations.Rui Ueyama2018-02-201-17/+0
| | | | | | | | | | | | This patch removes `OutRelocations` vector from the InputChunk and directly consume `Relocations` vector instead. This should make the linker faster because we don't create a temporary data structure, and it matches the lld's design principle that we don't create temporary data structures for object files but instead directly consume mmap'ed data whenever possible. Differential Revision: https://reviews.llvm.org/D43491 llvm-svn: 325549
* Refactor wasm/WriterUtil.{cpp,h}.Rui Ueyama2018-02-161-26/+19
| | | | | | | | | | | | | | | | Summary: - Makes code more in line with LLVM style (e.g. const char * -> StringRef) - Do not use formatv since we can construct message just by `+` - Replace some odd types such as `const StringRef` with more common type - Do not use default arguments if they are not necessary Reviewers: sbc100 Subscribers: jfb, aheejin, llvm-commits, sunfish Differential Revision: https://reviews.llvm.org/D43403 llvm-svn: 325383
* Style fix. NFC.Rui Ueyama2018-02-161-24/+24
| | | | llvm-svn: 325377
* [WebAssembly] Update to match llvm change rL323901. NFCSam Clegg2018-01-311-4/+7
| | | | | | | | | | See: https://reviews.llvm.org/rL323901 Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42751 llvm-svn: 323903
* [WebAssembly] Allow function signature checking at link timeSam Clegg2017-11-301-0/+29
| | | | | | | | | | | | | | This change allows checking of function signatures but does not yes enable it by default. In this mode, linking two objects that were compiled with a different signatures for the same function will produce a link error. New options for enabling and disabling this feature have been added: (--check-signatures/--no-check-signatures). Differential Revision: https://reviews.llvm.org/D40371 llvm-svn: 319396
* Remove `else` or `break` after `fatal`. NFC.Rui Ueyama2017-11-291-3/+0
| | | | | | | fatal() does not return, so we don't need `else` or `break` after a call of fatal. llvm-svn: 319355
* [WebAssembly] Initial wasm linker implementationSam Clegg2017-11-171-0/+189
This linker backend is still a work in progress but is enough to link simple programs including linking against library archives. Differential Revision: https://reviews.llvm.org/D34851 llvm-svn: 318539
OpenPOWER on IntegriCloud