summaryrefslogtreecommitdiffstats
path: root/lld/wasm/MarkLive.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lld][WebAssembly] Refactor markLive.cpp. NFCSam Clegg2019-10-101-30/+61
| | | | | | | | | This pattern matches the ELF implementation add if also useful as part of a planned change where running `mark` more than once is needed. Differential Revision: https://reviews.llvm.org/D68749 llvm-svn: 374275
* [WebAssembly] Initialize memory in start functionThomas Lively2019-09-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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] Implement NO_STRIPDan Gohman2019-08-291-2/+2
| | | | | | | | | | | | | This patch implements support for the NO_STRIP flag, which will allow __attribute__((used)) to be implemented. This accompanies https://reviews.llvm.org/D62542, which moves to setting the NO_STRIP flag, and will continue to set EXPORTED for Emscripten targets for compatibility. Differential Revision: https://reviews.llvm.org/D66968 llvm-svn: 370416
* [WebAssembly] Rename variale references in comments after VariableName -> ↵Fangrui Song2019-07-161-2/+2
| | | | | | variableName change llvm-svn: 366192
* [Coding style change][lld] Rename variables for non-ELF portsRui Ueyama2019-07-111-61/+61
| | | | | | | | | | | 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
* [WebAssembly] Add option to emit passive segmentsThomas Lively2019-07-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds `--passive-segments` and `--active-segments` flags to control what kind of segments are emitted. For now the default is always to emit active segments so this is not a breaking change, but in the future the default will be changed to passive segments when shared memory is requested and active segments otherwise. When passive segments are emitted, corresponding memory.init and data.drop instructions are emitted in a `__wasm_init_memory` function that is automatically called at the beginning of `__wasm_call_ctors`. Reviewers: sbc100, aheejin, dschuff Subscribers: azakai, dschuff, jgravelle-google, sunfish, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59343 llvm-svn: 365088
* [WebAssembly] Fix for discarded init functionsSam Clegg2019-06-071-2/+5
| | | | | | | | | When a function is excluded via comdat we shouldn't add it to the final list of init functions. Differential Revision: https://reviews.llvm.org/D62983 llvm-svn: 362769
* [WebAssembly] Apply data relocations at runtime in shared objectsSam Clegg2019-04-041-0/+5
| | | | | | | | | | | | | See: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Data section relocations in wasm shared libraries are applied by the library itself at static constructor time. This change adds a new synthetic function that applies relocations to relevant memory locations on startup. Differential Revision: https://reviews.llvm.org/D59278 llvm-svn: 357715
* [WebAssebmly] Allow __wasm_call_ctors to be GC'edSam Clegg2019-03-011-9/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D58806 llvm-svn: 355240
* [WebAssembly] clang-tidy (NFC)Heejin Ahn2019-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes clang-tidy warnings on wasm-only files. The list of checks used is: `-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming,modernize-*` (LLVM's default .clang-tidy list is the same except it does not have `modernize-*`.) The list of fixes are: - Variable names start with an uppercase letter - Function names start with a lowercase letter - Use `auto` when you use casts so the type is evident Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57499 llvm-svn: 353076
* [WebAssembly] Update relocation naming to match llvm change. NFC.Sam Clegg2019-02-041-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D57698 llvm-svn: 353066
* 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] Add support for the event sectionHeejin Ahn2018-12-081-0/+4
| | | | | | | | | | | | | | | | | 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-2/+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] Add support for bitcode archive membersSam Clegg2018-06-281-2/+2
| | | | | | | | | | This change effects the behavior of --export-all. Previously --export-all would only effect symbols that survived GC. Now --export-all will prevent any non-local symbols from being GCed. Differential Revision: https://reviews.llvm.org/D48673 llvm-svn: 335878
* Revert "[WebAssembly] Error on mismatched function signature in final output"Sam Clegg2018-06-221-2/+3
| | | | | | | | | | This caused a lot of issues on the WebAssembly waterfall. In particular, until with the signature of `main`. We probably want a better solution for main before we re-land. Reverts rL335192 llvm-svn: 335355
* [WebAssembly] Only mark non-hidden symbols as live if they are also definedSam Clegg2018-06-211-2/+3
| | | | | | | | | Previously we were also marking undefined symbols (i.e. imports) as live. Differential Revision: https://reviews.llvm.org/D48299 llvm-svn: 335243
* [WebAssembly] Error on mismatched function signature in final outputSam Clegg2018-06-211-3/+2
| | | | | | | | | | | | | During symbol resolution, emit warnings for function signature mismatches. During GC, if any mismatched symbol is marked as live then generate an error. This means that we only error out if the mismatch is written to the final output. i.e. if we would generate an invalid wasm file. Differential Revision: https://reviews.llvm.org/D48394 llvm-svn: 335192
* [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] Implement -print-gc-sections, to better test GC of globalsNicholas Wilson2018-04-201-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D44311 llvm-svn: 330456
* [WebAssembly] Implement GC for importsNicholas Wilson2018-04-201-6/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D44313 llvm-svn: 330454
* [WebAssembly] Implement --print-gc-sections for synthetic functionsNicholas Wilson2018-04-201-0/+3
| | | | | | | | | | Enables cleaning up confusion between which name variables are mangled and which are unmangled, and --print-gc-sections then excersises and tests that. Differential Revision: https://reviews.llvm.org/D44440 llvm-svn: 330449
* [WebAssembly] Handle weak undefined functions with a synthetic stubNicholas Wilson2018-03-091-2/+19
| | | | | | | | | This error case is described in Linking.md. The operand for call requires generation of a synthetic stub. Differential Revision: https://reviews.llvm.org/D44028 llvm-svn: 327151
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-231-14/+3
| | | | | | | | | | | | | | | | | | 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
* [WebAssembly] Rename GlobalSymbol types. NFC.Sam Clegg2018-02-201-1/+1
| | | | | | | | | | | | | | | Purely a rename in preparation for adding new global symbol type. We want to use GlobalSymbol to represent real wasm globals and DataSymbol for pointers to things in linear memory (what ELF would call STT_OBJECT). This reduces the size the patch to add the explicit symbol table which is coming soon! Differential Revision: https://reviews.llvm.org/D43476 llvm-svn: 325645
* [WebAssembly] Expand a lambda that is used only once.Rui Ueyama2018-02-191-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43435 llvm-svn: 325536
* [WebAssembly] Define toString(wasm::InputChunk *) and use that in MarkLive.cpp.Rui Ueyama2018-02-191-8/+4
| | | | | | | | Define toString(wasm::InputChunk *) and use that in MarkLive.cpp. Differential Revision: https://reviews.llvm.org/D43434 llvm-svn: 325535
* [WebAssembly] Remove unneeded Chunk::getFileName() method. NFC.Sam Clegg2018-02-161-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43405 llvm-svn: 325414
* [WebAssembly] Fix typos in comment. NFC.Sam Clegg2018-02-161-3/+3
| | | | | | Patch by Nicholas Wilson! llvm-svn: 325370
* [WebAssembly] Refactor linker-generated symbols. NFC.Sam Clegg2018-02-021-1/+1
| | | | | | | | | | | | Group all synthetic symbols in the in single struct to match the ELF linker. This change is part of a larger change to add more linker symbols such as `_end` and `_edata`. Differential Revision: https://reviews.llvm.org/D42866 llvm-svn: 324157
* [WebAssembly] Add support for --gc-sectionsSam Clegg2018-01-311-0/+107
In this initial version we only GC symbols with `hidden` visibility since other symbols we export to the embedder. We could potentially modify this the future and only use symbols explicitly passed via `--export` as GC roots. This version of the code only does GC of data and code. GC for the types section is coming soon. Differential Revision: https://reviews.llvm.org/D42511 llvm-svn: 323842
OpenPOWER on IntegriCloud