summaryrefslogtreecommitdiffstats
path: root/lld/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Add test for imported ctor and fix indexing bug foundNicholas Wilson2018-03-121-3/+2
| | | | | | | | | This bug was found by accident while trying to expand out testcases for imported symbols, and is covered by the additional test case. Differential Revision: https://reviews.llvm.org/D44331 llvm-svn: 327290
* [WebAssembly] Reorder synthetic functions to come firstNicholas Wilson2018-03-121-5/+3
| | | | | | | | | This matches the existing ordering that's been there for globals for a while (__stack_pointer coming first). Differential Revision: https://reviews.llvm.org/D44333 llvm-svn: 327286
* [WebAssembly] Improve logging and comments around relocations. NFC.Sam Clegg2018-03-112-8/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D44350 llvm-svn: 327232
* [WebAssembly] Remove a second parameter from toString().Rui Ueyama2018-03-093-5/+4
| | | | | | | | | | | | toString(T) is a stringize function for an object of type T. Each type that has that function defined should know how to stringize itself, and there should be one string representation of an object. Passing a "supplemental" argument to toString() breaks that princple. We shouldn't add a second parameter to that function. Differential Revision: https://reviews.llvm.org/D44323 llvm-svn: 327182
* [WebAssembly] Handle weak undefined functions with a synthetic stubNicholas Wilson2018-03-095-13/+66
| | | | | | | | | 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] Refactor order of creation for SyntheticFunctionNicholas Wilson2018-03-096-36/+45
| | | | | | | | | | Previously we created __wasm_call_ctors with null InputFunction, and added the InputFunction later. Now we create the SyntheticFunction with null body, and set the body later. Differential Revision: https://reviews.llvm.org/D44206 llvm-svn: 327149
* [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] Honor --allow-undefined even for explicit exportsSam Clegg2018-03-081-1/+1
| | | | | | | | | | | | | | | | When a symbol is exported via --export=foo but --allow-undefined is also specified, the symbol is now allowed to be undefined. Previously we were special casing such symbols. This combinations of behavior is exactly what emescripten requires. Although we are trying hard not to allow emscripten specific features in lld, this one makes sense. Enforce this behavior by added this case to test/wasm/undefined.ll. Differential Revision: https://reviews.llvm.org/D44237 llvm-svn: 326976
* [WebAssembly] Run clang-format. NFCNicholas Wilson2018-03-079-23/+25
| | | | llvm-svn: 326896
* [WebAssembly] Remove duplicated line of code and unreachable check. NFCNicholas Wilson2018-03-071-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D44146 llvm-svn: 326888
* [WebAssembly] Use StringSaver to retain ownership of ctor function body. NFCNicholas Wilson2018-03-072-6/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D44149 llvm-svn: 326885
* [WebAssembly] Reorder reloc sections to come after symtabNicholas Wilson2018-03-051-1/+1
| | | | | | | | This matches LLVM change D43940. Differential Revision: https://reviews.llvm.org/D43946 llvm-svn: 326693
* [WebAssembly] Simplify createDefined. NFC.Rui Ueyama2018-03-021-10/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43849 llvm-svn: 326615
* [WebAssembly] Rename global types to match the notation in the specNicholas Wilson2018-03-021-4/+2
| | | | llvm-svn: 326583
* [WebAssembly] Export non-hidden defined data symbols via wasm globalsNicholas Wilson2018-03-021-7/+1
| | | | | | | | This fixes a TODO introduced in rLLD325861. Differential Revision: https://reviews.llvm.org/D43930 llvm-svn: 326581
* [WebAssembly] Pass ownership of body to SyntheticFunction. NFCNicholas Wilson2018-03-022-15/+15
| | | | | | | | | This avoids the Writer unnecessarily having a member to retain ownership of the function body. Differential Revision: https://reviews.llvm.org/D43933 llvm-svn: 326580
* [WebAssembly] Add validation for init function signatureNicholas Wilson2018-03-021-3/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D43947 llvm-svn: 326579
* [WebAssembly] Simplify COMDAT handling.Rui Ueyama2018-03-013-22/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D43966 llvm-svn: 326509
* [WebAssembly] Use uint8_t for single byte values to match the specSam Clegg2018-03-013-12/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D43922 llvm-svn: 326455
* [WebAssembly] Reorder exports to match symbol table orderNicholas Wilson2018-03-011-22/+6
| | | | | | | | This fixes a TODO introduced in rLLD325861. Differential Revision: https://reviews.llvm.org/D43877 llvm-svn: 326424
* [WebAssembly] Remove unused forward declaration.Rui Ueyama2018-03-011-2/+0
| | | | llvm-svn: 326411
* [WebAssembly] Use Twine rather than StringRef for logging messagesSam Clegg2018-03-012-15/+19
| | | | | | | | Also add missing tracing to writeU8. Differential Revision: https://reviews.llvm.org/D43919 llvm-svn: 326398
* Use DenseMap::lookup() instead of find() and a hand-written null check.Rui Ueyama2018-02-281-4/+1
| | | | llvm-svn: 326382
* [WebAssembly] Reduce code repetition. NFC.Rui Ueyama2018-02-283-21/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D43910 llvm-svn: 326379
* [WebAssembly] Use toArrayRef. NFC.Rui Ueyama2018-02-281-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D43855 llvm-svn: 326340
* [WebAssembly] Return a StringRef instead of std::string from ↵Rui Ueyama2018-02-282-8/+8
| | | | | | | | getSectionName(). NFC. Differential Revision: https://reviews.llvm.org/D43854 llvm-svn: 326337
* [WebAssembly] Improve WasmSignatureDenseMapInfo.Rui Ueyama2018-02-281-4/+3
| | | | | | | | | | | | | | Let X and Y be types. Previously, functions F(X, Y) and G(Y, X) had the same hash value because their hash values are computed as follows: hash(F) = hash(X) + hash(Y) hash(G) = hash(Y) + hash(X) This patch fixes the issue by using hash_combine. Differential Revision: https://reviews.llvm.org/D43856 llvm-svn: 326336
* [WebAssembly] Fix variable name.Rui Ueyama2018-02-281-1/+1
| | | | llvm-svn: 326301
* [WebAssembly] Remove unnecessary namespace specifiers. NFC.Rui Ueyama2018-02-281-2/+2
| | | | llvm-svn: 326300
* [WebAssembly] Simplify initializeSymbols and merge it with ObjFile::parse. NFC.Rui Ueyama2018-02-282-70/+43
| | | | | | | | | | | This patch simplifies initializeSymbols. Since that function is called at the tail context of ObjFile::parse, and the function is called only once from that function, that's effectively just a continuation of ObjFile::parse. So this patch merge it with ObjFile::parse. Differential Revision: https://reviews.llvm.org/D43848 llvm-svn: 326296
* [WebAssembly] Simplify Symbol::getWasmType. NFC.Rui Ueyama2018-02-281-10/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D43717 llvm-svn: 326293
* [WebAssembly] Inline translateVA as it's trivial.Rui Ueyama2018-02-283-11/+3
| | | | | | | | | | | The problem I want to address now is that chunks have too many data members for "offsets", and their origins are not well defined. For example, InputSegment has OutputSegmentOffset, but it's base class also has OutputOffset. That's very confusing. Differential Revision: https://reviews.llvm.org/D43726 llvm-svn: 326291
* [WebAssembly] Remove ELF-ness.Rui Ueyama2018-02-281-10/+6
| | | | | | | | | These output section names are ELF-specific. We shouldn't have this rule for WebAssembly. Differential Revision: https://reviews.llvm.org/D43712 llvm-svn: 326289
* [WebAssembly] Do not use inheritance to define SubSection.Rui Ueyama2018-02-283-60/+58
| | | | | | | | | | | | | | SubSection inherited from SyntheticSection, and SyntheticSection inherits from OutputSection, so SubSection was an OutputSection. But that's wrong because SubSection is not actually a WebAssembly output section. It shares some functionalities with OutputSection, but overall it's very different. This patch removes that inheritance. Differential Revision: https://reviews.llvm.org/D43719 llvm-svn: 326286
* [WebAssembly] Refactor ObjFile::initializeSymbols.Rui Ueyama2018-02-282-66/+47
| | | | | | | | The main purpose of this change is to make initializeSymbols shorter. Differential Revision: https://reviews.llvm.org/D43691 llvm-svn: 326285
* [WebAssembly] Do not use Subsection as a local variable name.Rui Ueyama2018-02-281-40/+39
| | | | | | | | That variable hides the class of the same name. Differential Revision: https://reviews.llvm.org/D43718 llvm-svn: 326283
* [WebAssembly] Do not use default arguments for SymbolTable.Rui Ueyama2018-02-282-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43727 llvm-svn: 326282
* [WebAssembly] Do not remove existing output file.Rui Ueyama2018-02-281-1/+0
| | | | | | | | | | | | | | | | FileOutputBuffer automatically removes an existing file, so we don't need to do that. Actually doing that is discouraged because when the linker fails to create an output for some reason after instantiating FileOutputBufffer, FileOutputBuffer removes a temporary file and don't touch an existing file. That's an desired behavior from the user's point of view. (Internally, FileOutputBuffer writes its contents to a temporary file and then rename it over to an existing file on commit()). Differential Revision: https://reviews.llvm.org/D43728 llvm-svn: 326281
* [WebAssembly] Remove redundant local variables.Rui Ueyama2018-02-281-10/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D43709 llvm-svn: 326280
* [WebAssembly] Simplify createLikingSection.Rui Ueyama2018-02-281-7/+17
| | | | | | | | | | | | Summary: [WebAssembly] Simplify createLikingSection. Reviewers: sbc100 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43715 llvm-svn: 326279
* [WebAssembly] Inline accessor functions that are called only once.Rui Ueyama2018-02-282-63/+19
| | | | | | | | | | | | Looks like these accessor functions are a bit overly defensive, and due to the amount of code, that part isn't easy to read. We have code to log translation results in writeTo and writeRelocations, so I don't think we need to log it again in these functions. I think the new function is much easier to understand. Differential Revision: https://reviews.llvm.org/D43713 llvm-svn: 326277
* [WebAssembly] Remove trivial accessors.Rui Ueyama2018-02-283-15/+9
| | | | | | | | {set,get}OutputSegment don't hide anything, so remove them. Differential Revision: https://reviews.llvm.org/D43724 llvm-svn: 326276
* [WebAssembly] Use more specific type and simplify code.Rui Ueyama2018-02-281-20/+13
| | | | | | | | | Instead of {Function,Global,Data}Symbol, use Defined{Function,Global,Data} because undefined symbol should never reach this function. Differential Revision: https://reviews.llvm.org/D43710 llvm-svn: 326275
* [WebAssembly] Remove LastDefinedKind for consistency with undefined kinds. NFC.Rui Ueyama2018-02-281-6/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43711 llvm-svn: 326274
* [WebAssembly] Remove premature optimization.Rui Ueyama2018-02-281-1/+1
| | | | | | | | | | I think calling reserve() for each object file is too many and isn't useful. We can add reserve() later. By default, we shouldn't add reserve() to a lot of places. Differential Revision: https://reviews.llvm.org/D43722 llvm-svn: 326273
* [WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.Rui Ueyama2018-02-284-128/+150
| | | | | | | | | | | | | | | Previously, one function adds all types of undefined symbols. That doesn't fit to the wasm's undefined symbol semantics well because different types of undefined symbols are very different in wasm. As a result, separate control flows merge in this addUndefined function and then separate again for each type. That wasn't easy to read. This patch separates the function into three functions. Now it is pretty clear what we are doing for each undefined symbol type. Differential Revision: https://reviews.llvm.org/D43697 llvm-svn: 326271
* [WebAssembly] Use StringRef instead of `const char *`.Rui Ueyama2018-02-281-10/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D43721 llvm-svn: 326269
* [WebAssembly] Remove DataSize from linking metadataSam Clegg2018-02-271-16/+9
| | | | | | | | | This means we don't need to write the linking metadata section at all for executable (non-relocatable) output. Differential Revision: https://reviews.llvm.org/D42869 llvm-svn: 326268
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-1/+0
| | | | llvm-svn: 326018
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-4/+0
| | | | llvm-svn: 326017
OpenPOWER on IntegriCloud