Commit Graph

10588 Commits

Author SHA1 Message Date
Dan Gohman
0d825b4643 Remove a redundant .into(). 2017-11-08 10:43:11 -08:00
Dan Gohman
3ab4349c1b Use Self instead of repeating the type name. 2017-11-08 10:43:11 -08:00
Dan Gohman
b7f979a8be Combine identical match arms. 2017-11-08 10:40:43 -08:00
Dan Gohman
388ebde41d Use .any(...) rather than .position(...).is_some(). 2017-11-08 10:40:42 -08:00
Dan Gohman
8b053aa923 Remove a trivial cast. 2017-11-08 10:40:39 -08:00
Dan Gohman
24e185c8c5 Remove unnecessary parens. 2017-11-08 10:40:37 -08:00
Dan Gohman
d7796cbf25 Suppress an unused-import warning on AsciiExt.
See

https://users.rust-lang.org/t/psa-dealing-with-warning-unused-import-std-ascii-asciiext-in-today-s-nightly/13726

for details.
2017-11-08 10:40:29 -08:00
Dan Gohman
2b6502ac6e Fix handling of CFG triangles in compute_postorder.
For example, in `loops_one`, ebb3 is the bottom of a triangle, so
postorder should order it after the rest of the triangle.
2017-11-07 16:57:22 -08:00
Dan Gohman
849f090562 Fix nondeterminism in br_table translation. 2017-11-07 15:33:35 -08:00
Dan Gohman
15aff899ee Block no longer needs to implement Hash. 2017-11-07 15:19:55 -08:00
Dan Gohman
6d91a32d39 Add comments about "user" parameters. 2017-11-07 15:13:46 -08:00
Dan Gohman
cbb99bf233 Rename "user_arg_count" to "user_param_count" for consistency. 2017-11-07 15:13:46 -08:00
Dan Gohman
9b15fe7dfd Simplify Ebb parameter creation.
Ebb parameters are appended explicitly by whoever calls create_block,
so they don't need to also be inferred from branches. This makes the
frontend code more flexible for producers that want to create things
in a different order, and it eliminates more temporary allocations.

FunctionBuilder no longer maintains its own list of the function
parameter values; these can be obtained from the ebb parameter list
on the entry block.
2017-11-07 15:13:00 -08:00
Dan Gohman
cce2384ede Remove switch_to_block's jump_args argument.
switch_to_block doesn't need its jump_args argument, since jump
arguments are handled by the `jump` instruction and others, rather
than on the switch to a new ebb itself.
2017-11-06 16:38:13 -08:00
Dan Gohman
f76640778c Fix printing with -p when -c is also given. 2017-11-06 16:28:15 -08:00
Dan Gohman
5dda19035d Implement Hash for ExternalName.
This allows users to have HashMaps etc. with ExternalNames as keys.
2017-11-06 11:34:09 -08:00
Dan Gohman
1d8df2ed1e Remove the requirement that Variable implement Default. 2017-11-06 11:10:14 -08:00
Dan Gohman
4091688cc0 Avoid unnecessary name qualification. 2017-11-06 11:10:03 -08:00
Dan Gohman
d9743290ea Elide elidable lifetime parameters. 2017-11-06 11:09:56 -08:00
Dan Gohman
9ee6e740b0 Merge pull request #3 from m4b/patch-1
obj: minor fix to emit_module compile
2017-11-05 14:03:58 -08:00
m4b
89d3038c1c obj: minor fix to emit_module compile 2017-11-05 00:03:56 -07:00
Dan Gohman
114da83ad6 Avoid using to_string() on ExternalName to create strings for symbol names.
ExternalName's `to_string()` prepends a '%' for Cretonne's text syntax,
but for creating symbol names we just want the raw bytes.
2017-11-04 15:29:16 -07:00
Dan Gohman
be9e3e88e4 Emit wasm data initializers as faerie data segments.
This is a temporary measure while other parts of the system are being
developed, and will need to be replaced by a proper solution.
2017-11-04 15:28:19 -07:00
Dan Gohman
8501cb798e Minor comment cleanups. 2017-11-03 16:43:29 -07:00
Dan Gohman
acc6d941a3 Combine redundant match arm bodies. 2017-11-03 16:40:51 -07:00
Dan Gohman
c7f01f88b2 Clarify some comments. 2017-11-03 11:44:58 -07:00
Dan Gohman
e21479a843 Mark check_return_args as #[cfg(debug_assertions)]. 2017-11-02 12:28:01 -07:00
Dan Gohman
1cbf921d9d Add a function to seal all the blocks at once. 2017-11-02 08:00:55 -07:00
Dan Gohman
04660ae8cc Rename "wast" to "wat" in filetests too. 2017-11-02 07:46:18 -07:00
Dan Gohman
c30116d948 Fix copypasta in a FIXME message. 2017-11-02 07:42:03 -07:00
Dan Gohman
c6d39dea5d Add a comment about shrink_to_fit(). 2017-11-01 11:35:15 -07:00
Dan Gohman
61a51f5275 Rename a variable to clarify its purpose. 2017-11-01 11:34:16 -07:00
Dan Gohman
57041ea9eb Tidy up semicolons. 2017-11-01 11:30:37 -07:00
Dan Gohman
39c0fbb6c7 Assert that sealed blocks cannot accept new predecessors. 2017-11-01 11:27:54 -07:00
Dan Gohman
1663f141c8 Tidy up unneeded parentheses. 2017-11-01 11:26:55 -07:00
Dan Gohman
aa724846f6 Clear the wasm operand stack at the end of a function.
This preserves an invariant that the stack is empty between function
body translations.
2017-11-01 11:25:22 -07:00
Dan Gohman
09b1bdc108 Make "cton-util compile" default to the isa specified in the test file. 2017-10-31 14:21:07 -07:00
Dan Gohman
5f8b1b9f04 Fix a flake8 lint. 2017-10-31 13:05:26 -07:00
Dan Gohman
3d83d0e4f0 Clean up redundant blank lines. 2017-10-31 12:45:22 -07:00
Dan Gohman
2b40f72f00 Update for more Cretonne API changes.
This updates to ExternalName and reloc_external.
2017-10-31 12:36:53 -07:00
Dan Gohman
871bf95acf Change reloc_ebb to pass a CodeOffset rather than an Ebb index. 2017-10-31 12:26:38 -07:00
Dan Gohman
5d063eb8bc Merge reloc_func and reloc_globalsym into reloc_external. 2017-10-31 12:26:33 -07:00
Dan Gohman
b60b2ce135 Change parse_multiline to follow PEP 257.
The main change is that it avoids creating blank lines when processing
docstrings.

This also adds blank lines in various places to make the generated code
prettier.
2017-10-31 12:21:23 -07:00
Dan Gohman
149a41a684 Clean up copypasta. 2017-10-31 12:21:14 -07:00
Dan Gohman
9c54c3fff0 Introduce globalsym_addr.
This is an instruction used in legalization of GlobalVarData::Sym global
variables.
2017-10-30 13:26:56 -07:00
Dan Gohman
cb805f704d Put BaldrMonkey-specific behavior under a setting.
BaldrMonkey will need to enable allones_funcaddrs.
2017-10-30 13:26:56 -07:00
Dan Gohman
6fc45b070a Add a new kind of GlobalVar for symbolic addresses.
These addresses will allow referencing C/C++/Rust-style global variables
by name directly.
2017-10-30 13:26:56 -07:00
Dan Gohman
c2665385b1 Rename FunctionName to ExternalName. 2017-10-30 13:26:56 -07:00
Dan Gohman
fae5ffb556 Make generated code more consistent with current rustfmt. 2017-10-30 10:06:23 -07:00
Dan Gohman
226fbce0b3 Update for Cretonne API changes. 2017-10-28 06:11:56 -07:00