Commit Graph

12 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
b6fa40d6a3 Add a return_reg instruction to the base instruction set.
Register-style return is used by all RISC architectures, so it is
natural to have a shared instruction representation.
2017-02-21 13:05:17 -08:00
Jakob Stoklund Olesen
859cca081c Upgrade to rustfmt 0.7.1 2017-01-25 15:17:27 -08:00
Jakob Stoklund Olesen
0d77b19708 Use PackedOption<Value> instead of NO_VALUE.
- Remove NO_VALUE and ExpandedValue::None.
- Remove the Default implelmentation for Value.
- InstructionData::second_result() returns an Option<Value>.
- InstructionData::second_result() returns a reference to the packed
  option.
2017-01-19 15:55:18 -08:00
Jakob Stoklund Olesen
1389a51c7a Avoid using NO_INST in the parser.
This was only used for the comment rewrite mechanism, and we can just
predict the next allocated instruction number instead. See the other
uses of next_key() for gather_comments().
2017-01-19 14:49:55 -08:00
Jakob Stoklund Olesen
2f6a33f16d Use PackedOption<Ebb> to represent jump tables.
Avoid NO_EBB.
2017-01-19 13:41:56 -08:00
Jakob Stoklund Olesen
8d6d59cc7a Gather comments in the preamble of a test file.
Comments preceding the first function are not associated with any
specific entity in the file. Put them in a TestFile::preamble_comments
field.
2016-11-04 10:42:31 -07:00
Jakob Stoklund Olesen
e2418c6ec9 Require documentation on reader public items. 2016-10-26 17:43:18 -07:00
Jakob Stoklund Olesen
df06f19979 Parse signature and function declarations.
Also add support for parsing call and call_indirect instructions.
2016-10-18 13:19:24 -07:00
Jakob Stoklund Olesen
bdc95990d4 Add call and call_indirect instructions.
Add a new IndirectCall instruction format which has a value callee as
well as the call arguments.

Define call and call_indirect instructions.
2016-10-18 10:04:06 -07:00
Jakob Stoklund Olesen
b8a76822cf Track signatures and function references in the source map. 2016-10-18 09:43:20 -07:00
Jakob Stoklund Olesen
80a6ae203d Generalize def_inst() to def_entity().
Use this source map method for assigning a location to any entity whose
source number is not exposed. This could be

- Instructions.
- Signatures defined implicitly by function decls.

These entities only appear in the location map, not the entity number
maps.
2016-10-18 09:38:05 -07:00
Jakob Stoklund Olesen
846db00a21 Move library crates under 'lib/'.
Give these crates each a more standard directory layout with sources in
a 'src' sub-sirectory and Cargo.toml in the top lib/foo directory.

Add license and description fields to each.

The build script for the cretonne crate now lives in
'lib/cretonne/build.rs' separating it from the normal library sources
under 'lib/cretonne/src'.
2016-10-17 14:44:43 -07:00