summaryrefslogtreecommitdiffstats
path: root/lld/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssebmly] Minor simplification. NFC.Rui Ueyama2018-02-241-5/+6
| | | | llvm-svn: 326013
* Do not use `auto` for type that is not obvious in a local context.Rui Ueyama2018-02-241-2/+2
| | | | llvm-svn: 326012
* Remove dead code.Rui Ueyama2018-02-231-2/+0
| | | | llvm-svn: 325955
* Inline printHelp.Rui Ueyama2018-02-231-5/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43526 llvm-svn: 325953
* Handle --version before handling --mllvm.Rui Ueyama2018-02-231-5/+6
| | | | | | | | Because it's a waste of time to handle --mllvm before --version. Differential Revision: https://reviews.llvm.org/D43527 llvm-svn: 325952
* Inline a trivial ctor.Rui Ueyama2018-02-231-15/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43525 llvm-svn: 325948
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-2315-398/+700
| | | | | | | | | | | | | | | | | | 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] Move lambda declaration output of loop. NFC.Sam Clegg2018-02-231-22/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D43534 llvm-svn: 325857
* [WebAssembly] Use make<> rather then make_unique<>. NFC.Sam Clegg2018-02-211-5/+4
| | | | | | | | | lld uses an arena allocator to one of allocations like these can just use make<>. Differential Revision: https://reviews.llvm.org/D43587 llvm-svn: 325706
* [WebAssembly] Rename member DefinedFunctions -> InputFunctions. NFC.Sam Clegg2018-02-211-16/+16
| | | | | | | | | This avoids confusion with the `DefinedFunction` symbol type. Differential Revision: https://reviews.llvm.org/D43588 llvm-svn: 325705
* [WebAssembly] Use stable sort when sorting ctore functionsSam Clegg2018-02-211-4/+4
| | | | | | Patch by Nicholas Wilson! llvm-svn: 325656
* [WebAssembly] Rename GlobalSymbol types. NFC.Sam Clegg2018-02-209-92/+92
| | | | | | | | | | | | | | | 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
* Consistent (non) use of empty lines in include blocksSam Clegg2018-02-209-13/+4
| | | | | | | | | 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
* Use more early returns in SymbolTable.cpp.Rui Ueyama2018-02-201-33/+46
| | | | | | | | | | | I think if statements that end with return is easier to read than cascaded if-else-if-else-if statements because it makes clear that execution of a function terminates there. This patch also adds more blank lines to separate code blocks to meaningful pieces. Differential Revision: https://reviews.llvm.org/D43517 llvm-svn: 325625
* [WebAssembly] Remove unused headerSam Clegg2018-02-201-1/+1
| | | | llvm-svn: 325624
* feedbackSam Clegg2018-02-201-15/+8
| | | | llvm-svn: 325614
* [WebAssembly] Split addDefined into two different methods. NFC.Sam Clegg2018-02-203-42/+54
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43496 llvm-svn: 325613
* [WebAssembly] Remove unused headerSam Clegg2018-02-202-2/+0
| | | | | | | | | This header used to be needed here for the `OutRelocation` struct but that no longer exists. Differential Revision: https://reviews.llvm.org/D43516 llvm-svn: 325608
* [WebAssembly] Remove InputChunk from Symbol baseclassSam Clegg2018-02-202-36/+44
| | | | | | | | | | Instead include InputFuction and InputSegment directly in the subclasses that use them (DefinedFunction and DefinedGlobal). Differential Revision: https://reviews.llvm.org/D43493 llvm-svn: 325603
* [WebAssembly] Check signatures of weakly defined funtions tooSam Clegg2018-02-201-0/+1
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43492 llvm-svn: 325598
* Do not create a temporary data structure for relocations.Rui Ueyama2018-02-205-106/+72
| | | | | | | | | | | | 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
* Merge two small functions and add comments.Rui Ueyama2018-02-191-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43406 llvm-svn: 325538
* Removed a variable that is used only once.Rui Ueyama2018-02-191-3/+3
| | | | llvm-svn: 325537
* [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-193-8/+10
| | | | | | | | Define toString(wasm::InputChunk *) and use that in MarkLive.cpp. Differential Revision: https://reviews.llvm.org/D43434 llvm-svn: 325535
* [WebAssembly] Remove unneeded classifer methods from Symbol class. NFC.Sam Clegg2018-02-174-11/+4
| | | | | | | | | We already have isa<> for this, and these methods were simply duplicating those redundantly. Differential Revision: https://reviews.llvm.org/D43422 llvm-svn: 325418
* [WebAssembly] Simplify FunctionSymbol::get/set/hasFunctionType. NFC.Sam Clegg2018-02-166-46/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D43416 llvm-svn: 325415
* [WebAssembly] Remove unneeded Chunk::getFileName() method. NFC.Sam Clegg2018-02-162-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43405 llvm-svn: 325414
* Do not print out "no input files" twice.Rui Ueyama2018-02-161-6/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D43408 llvm-svn: 325406
* Remove `else` after `break`.Rui Ueyama2018-02-161-6/+4
| | | | llvm-svn: 325387
* Use write32le instead of write32<little>.Rui Ueyama2018-02-161-1/+2
| | | | llvm-svn: 325384
* Refactor wasm/WriterUtil.{cpp,h}.Rui Ueyama2018-02-164-40/+33
| | | | | | | | | | | | | | | | 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
* [WebAssebmly] Remove unneeded cast. NFC.Sam Clegg2018-02-161-1/+1
| | | | llvm-svn: 325382
* Style fix. NFC.Rui Ueyama2018-02-162-33/+33
| | | | llvm-svn: 325377
* [WebAssembly] Fix bug is function signature checkingSam Clegg2018-02-161-1/+1
| | | | | | | | | | This bug effected undefined symbols that were resolved by existing defined symbols. We were skipping the signature check in this case. Differential Revision: https://reviews.llvm.org/D43399 llvm-svn: 325376
* [WebAssembly] Fix typos in comment. NFC.Sam Clegg2018-02-161-3/+3
| | | | | | Patch by Nicholas Wilson! llvm-svn: 325370
* [WebAssebmly] Remove use of Optional to fix assertion in gccSam Clegg2018-02-142-8/+14
| | | | | | | | | | | | | | This was causing GCC builds with fail with: Symbols.h:240:3: error: static assertion failed: Symbol types must be trivially destructible static_assert(std::is_trivially_destructible<T>( The reason this is a gcc-only failure is that OptionalStorage has as specialization for POD types that isn't built under GCC. Differential Revision: https://reviews.llvm.org/D43317 llvm-svn: 325185
* Revert r325158: Convert an assert to a static_assert. NFC.Rui Ueyama2018-02-141-2/+2
| | | | | | This reverts commit r325158 because it broke GCC builds. llvm-svn: 325183
* Remove a failing static_assert.Rui Ueyama2018-02-141-2/+0
| | | | | | | This static_assert is legitimate, but it is failing on some build environments. I'm removing it until it's fixed to unbreak the bots. llvm-svn: 325181
* Convert an assert to a static_assert. NFC.Sam Clegg2018-02-141-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D43305 llvm-svn: 325158
* [WebAssembly] Use a Symbol class heirarchy. NFC.Sam Clegg2018-02-147-194/+295
| | | | | | | | | This brings wasm into line with ELF and COFF in terms of symbol types are represented. Differential Revision: https://reviews.llvm.org/D43112 llvm-svn: 325150
* Use LLVM's SetVector insteead of unordered_set.Rui Ueyama2018-02-131-3/+2
| | | | | | | | | SetVector guarantees ordering, so with that we can get a deterministic output for error messages. Differential Revision: https://reviews.llvm.org/D43254 llvm-svn: 325064
* [WebAssembly] Unify concepts of discarded and non-live input chunks. NFC.Sam Clegg2018-02-133-12/+9
| | | | | | | | | It seems redundant to store this information twice. None of the locations where this bit is checked care about the distinction. Differential Revision: https://reviews.llvm.org/D43250 llvm-svn: 325046
* [WebAssembly] Cleanup methods for add synthetic symbols to symbtab. NFC.Sam Clegg2018-02-133-35/+31
| | | | | | | | | | | | These were duplicating (incorrectly) some of the logic for handling conflicts, but since they are only ever added right at the start we can assume no existing symbols. Also rename these methods for clarity. Differential Revision: https://reviews.llvm.org/D43252 llvm-svn: 325045
* [WebAssebmly] Remvoe trailing semicolon. NFC.Sam Clegg2018-02-091-1/+1
| | | | llvm-svn: 324716
* [WebAssembly] Remove redundant check global output indexSam Clegg2018-02-091-1/+1
| | | | llvm-svn: 324715
* [WebAssembly] Add __data_end link-sythentic symbol.Sam Clegg2018-02-074-2/+14
| | | | | | | | | | | | | | This is similar to _end (See https://linux.die.net/man/3/edata for more) but using our own unique name since our use cases will most likely be different and we want to keep our options open WRT to memory layout. This change will allow is to remove the DataSize from the linking metadata section which is currently being used by emscripten to derive the end of the data. Differential Revision: https://reviews.llvm.org/D42867 llvm-svn: 324443
* [WebAssembly] Refactor linker-generated symbols. NFC.Sam Clegg2018-02-026-40/+62
| | | | | | | | | | | | 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] Write minimal types sectionSam Clegg2018-01-314-24/+42
| | | | | | | | | | | | | | | | | | Don't include type signatures that are not referenced by some relocation. We don't include this in the -gc-sections settings since we are always building the type section from scratch, just like we do the table elements. In the future we might want to unify the relocation processing which is currently done once for gc-sections and then again for building the sympathetic type and table sections. Differential Revision: https://reviews.llvm.org/D42747 llvm-svn: 323931
* [WebAssembly] Update to match llvm change rL323901. NFCSam Clegg2018-01-314-9/+14
| | | | | | | | | | See: https://reviews.llvm.org/rL323901 Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42751 llvm-svn: 323903
OpenPOWER on IntegriCloud