Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port c2rust-transpile to syn, disable c2rust-refactor, llvm_asm! -> asm! #374

Merged
merged 92 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
cf40366
scripts/common: support testing when built with CARGO_TARGET_DIR set
fw-immunant Feb 16, 2022
1b99895
fix panic format-string missing argument
fw-immunant Feb 16, 2022
8e8a00c
fix a couple warnings (unused-parens, unused-variable)
fw-immunant Feb 17, 2022
85df0d4
fix Make error in tinycbor build under cmake under cargo
fw-immunant Feb 17, 2022
d811bff
convert c2rust-ast-builder to syn (first pass)
fw-immunant Jan 24, 2022
8418a22
convert c2rust-ast-printer to use forked prettyplease
fw-immunant Jan 24, 2022
e653578
impl Debug for Builder
fw-immunant Jan 28, 2022
3678c22
don't emit no_mangle on extern functions
fw-immunant Feb 14, 2022
4e0bee2
don't emit const_transmute feature, which no longer exists
fw-immunant Feb 14, 2022
8ca7e83
don't use removed const_raw_ptr_to_usize_cast feature
fw-immunant Feb 17, 2022
6820b11
do not emit const_transmute in generated test main functions
fw-immunant Feb 16, 2022
4273948
remove #[no_mangle] from extern "C" blocks in tests
fw-immunant Feb 14, 2022
f95a49d
do not emit #[no_mangle] on extern functions
fw-immunant Feb 16, 2022
612686e
remove MMX support from translator and tests
fw-immunant Feb 15, 2022
d8ff4af
P -> Box
fw-immunant Feb 15, 2022
7a1da92
replace empty string path segments with mk().abs_path()
fw-immunant Feb 15, 2022
8c04e5a
finish porting builder interface to syn
fw-immunant Feb 16, 2022
d50fd12
note libsyntax -> syn change in c2rust-ast-builder docs
fw-immunant Feb 16, 2022
1109716
c2rust: no longer require a specific nightly
fw-immunant Feb 16, 2022
3380fad
use Builder::int_unsuffixed_lit
fw-immunant Feb 16, 2022
54c504b
convert rest of literals
fw-immunant Feb 17, 2022
34831cd
convert consumers of astnode.kind to matching on the astnode itself
fw-immunant Feb 16, 2022
9c2ec82
rust_ast/traverse.rs: convert from libsyntax to syn
fw-immunant Feb 16, 2022
facdf8e
c2rust-transpile: convert binop/unop to take a token argument
fw-immunant Feb 16, 2022
2bc7171
generate label identifiers without apostrophes
fw-immunant Feb 17, 2022
e2aca30
generate anonymous field accesses rather than accessing fields named …
fw-immunant Feb 17, 2022
51e9e36
remove dead c2rust-ast-printer code
fw-immunant Feb 17, 2022
062d313
follow syn Field struct naming conventions
fw-immunant Feb 17, 2022
080452a
replace removed `wrapping_offset_from` method with `offset_from`
fw-immunant Feb 17, 2022
2f0260c
compare mutability by pattern-matching
fw-immunant Feb 17, 2022
8ee0b17
convert unsafe blocks to syn style
fw-immunant Feb 17, 2022
3fcf4e2
convert variadics and function declarations to syn style
fw-immunant Feb 17, 2022
4fb1ae0
convert MacroDelimiter usage to syn
fw-immunant Feb 17, 2022
47c4968
remove syntax::ptr::P imports, import syn definitions
fw-immunant Feb 17, 2022
ab7e302
c2rust-transpile/translator/mod.rs: import syn items
fw-immunant Feb 17, 2022
54674af
convert usage of TokenTree
fw-immunant Feb 17, 2022
ced35ed
remove usage of libsyntax with_globals context
fw-immunant Feb 17, 2022
5569a05
convert MetaItem construction
fw-immunant Feb 17, 2022
a9fc040
use semi_stmt in place of expr_stmt
fw-immunant Feb 17, 2022
e5c7a16
correct spelling of assignment_metaitem (fixup)
fw-immunant Feb 17, 2022
c50f375
update usage of meta_item builder methods
fw-immunant Feb 17, 2022
06733b9
define vis/ident/attrs accessors where necessary
fw-immunant Feb 17, 2022
e70afd5
arrange program header as a data structure rather than printing it im…
fw-immunant Feb 17, 2022
9466fb6
remove libsyntax workaround comment
fw-immunant Feb 17, 2022
ca7e087
implement Spanned for syn Spans
fw-immunant Feb 17, 2022
ed44b42
adapt syn Spans to required API
fw-immunant Feb 17, 2022
e60638a
implement span-setting for syn AST elements
fw-immunant Feb 17, 2022
4f1ce08
implement pretty-printing atop forked prettyplease
fw-immunant Feb 17, 2022
fb9faed
convert CommentStore to syn AST's comment restrictions
fw-immunant Feb 17, 2022
7d90e1c
use syn Span and our impls of functionality on it everywhere
fw-immunant Feb 17, 2022
3e7fd78
misc small libsyntax -> syn rewrites
fw-immunant Feb 17, 2022
f7ecc74
add dependencies
fw-immunant Feb 17, 2022
1d7cafd
add missing uses
fw-immunant Feb 17, 2022
9fb4052
make missing new comments non-fatal
fw-immunant Feb 17, 2022
a6d0d71
avoid generating transmute with a single type argument
fw-immunant Feb 17, 2022
8acdf37
make cur_file a static method
fw-immunant Feb 17, 2022
16d936b
use ToTokens when generating OffsetOf macro
fw-immunant Feb 17, 2022
1caae51
skip re-adding comments for now
fw-immunant Feb 17, 2022
d69a2a9
look through parens when inspecting casts
fw-immunant Feb 17, 2022
adb99eb
break c2rust dependency on c2rust-refactor
fw-immunant Feb 17, 2022
ba00864
remove c2rust-refactor from workspace
fw-immunant Mar 18, 2022
ce95d13
replace :ty with :ident in set_span macros
fw-immunant Mar 18, 2022
cc6f4bb
update toolchain to a recent-ish one
fw-immunant Mar 18, 2022
4f5bc5e
add vendored copy of prettyplease 1.1
fw-immunant Mar 18, 2022
f6e6f6e
add prettyplease info to LICENSE file
fw-immunant Mar 18, 2022
0af8316
prettyplease: remove nested workspace from Cargo.toml
fw-immunant Mar 18, 2022
507432b
prettyplease: expose more entrypoints
fw-immunant Mar 18, 2022
b8e9c11
prettyplease: add workaround for variadic ellipsis
fw-immunant Mar 18, 2022
8b2b292
rework precedence handling
fw-immunant Mar 31, 2022
29a5032
implement workaround for proc_macro2 source map assertion
fw-immunant Mar 14, 2022
4e20282
do not emit removed "main" feature
fw-immunant Mar 31, 2022
390233d
remove more redundant parentheses in output
fw-immunant Apr 1, 2022
3c57297
import (std|core)::arch::asm and ensure semicolon after asm!
fw-immunant Apr 1, 2022
67b0086
another parenthesization tweak
fw-immunant Apr 5, 2022
5a36639
WIP: work on asm conversion
fw-immunant Apr 5, 2022
c178f27
typo fix
fw-immunant Apr 5, 2022
a65f1ac
WIP: more work on asm conversion (arg references)
fw-immunant Apr 5, 2022
7bb1b61
bring asm conversion to basic completion
fw-immunant Apr 6, 2022
ac2172b
asm: translate "r" constraint
fw-immunant Apr 11, 2022
f6c403d
asm: handle by-index tied constraints properly
fw-immunant Apr 11, 2022
9535053
asm: fix token spacing
fw-immunant Apr 11, 2022
864435b
asm: mark outputs as clobbered for inout arguments with no out expres…
fw-immunant Apr 11, 2022
5d1f200
asm: translate memory/cc clobbers into options
fw-immunant Apr 11, 2022
33c0c51
asm: translate operand references in the asm expression itself
fw-immunant Apr 11, 2022
9f064a1
asm: try to detect whether AT&T or Intel syntax is used
fw-immunant Apr 12, 2022
38a4f06
asm: tweak dollar-sign handling
fw-immunant Apr 12, 2022
b5f376c
bump rust-toolchain to nightly-2021-11-22
fw-immunant Apr 12, 2022
b583b4d
asm: do not emit 'pure, readonly' options with no outputs
fw-immunant Apr 12, 2022
5a121d8
asm: handle reserved registers (for x86_64 only, for now)
fw-immunant Apr 12, 2022
aa58889
asm: angrily drop clobbers of reserved registers
fw-immunant Apr 12, 2022
bbfcac4
asm: remove dead commented-out line
fw-immunant Apr 12, 2022
b53b280
asm: document translate_modifier
fw-immunant Apr 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
"c2rust",
"c2rust-transpile",
"c2rust-refactor",
"c2rust-ast-builder",
"c2rust-ast-exporter",
"c2rust-ast-printer",
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
Portions of C2Rust are derived from packages written by third parties. The following third party packages are included, and carry their own copyright notices and license terms:

* c2rust-ast-printer. Dual-licensed under Apache 2.0 and MIT, see c2rust-ast-printer/COPYRIGHT for details.
* prettyplease. Dual-licensed under Apache 2.0 and MIT, see prettyplease/LICENSE-* for details.
2 changes: 2 additions & 0 deletions c2rust-ast-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ repository = "https://github.com/immunant/c2rust"
description = "Rust AST builder support crate for the C2Rust project"

[dependencies]
proc-macro2 = { version = "1.0", features = ["span-locations"]}
syn = { version = "1.0", features = ["full", "proc-macro", "printing"] }
Loading