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

Bump to rustc nightly 2019-04-08 #49

Merged
merged 66 commits into from
Apr 10, 2019
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5b169cb
Updates to build c2rust-ast-builder with latest nightly toolchain
thedataking Mar 7, 2019
e06eca9
Updates to build c2rust-transpile with latest nightly toolchain
thedataking Mar 7, 2019
37f07e1
Get rid of ThinTokenStream in c2rust-refactor
thedataking Mar 7, 2019
d68ef6a
Use libc from crates.io in dynamic-dlsym and zstd-logging cross-check…
ahomescu Mar 8, 2019
3a003ae
Merge branch 'master' into feature/bump-nightly
rinon Mar 9, 2019
496c949
Temporary commit during c2rust-refactor update
rinon Mar 9, 2019
3a31288
Merge remote-tracking branch 'origin/feature/bump-nightly' into featu…
rinon Mar 9, 2019
5ff9333
WIP: Rewrite fold nodes API
rinon Mar 10, 2019
410ee37
WIP: Finished making the type checker happy
rinon Mar 12, 2019
dd44bfa
avoid using deprecated APIs
thedataking Mar 13, 2019
27829df
Remove need for access to rustc interner
rinon Mar 13, 2019
6b6d7a9
Finish updating refactoring to use MutVisit
rinon Mar 13, 2019
2c6d1a8
Pin nightly toolchain version
thedataking Mar 13, 2019
d2c5e57
Fix refactoring tool AST uses for new nightly
rinon Mar 22, 2019
7ba83ef
Update refactoring to use new nightly compiler driver interface
rinon Mar 22, 2019
dfa4cda
Make RefactorState own its Compiler and rebuild it on re-running
rinon Mar 27, 2019
06dfe62
Don't reuse parser instances for string parsing
rinon Mar 27, 2019
63bde2a
Fix illtyped folder calling node_def_id for nodes without def ids
rinon Mar 28, 2019
5992a42
Don't reuse parsers for anonymous strings
rinon Mar 28, 2019
09401c8
Implement MutVisit::visit invocations for flat_map types
rinon Mar 29, 2019
cd59efc
Clean up crate collapsing and make sure it matches previous behavior
rinon Mar 29, 2019
cf0946b
Add back in the dummy source file at offset 0
rinon Mar 29, 2019
060416c
Use the correct replacement for CrateRoot (PathRoot)
rinon Mar 29, 2019
2357512
Add Debug trait for easier debug invocations
rinon Mar 29, 2019
5f2e8c9
Add dump_crate debug command
rinon Mar 29, 2019
8a8543a
Use unique FileNames for more string parsers
rinon Mar 29, 2019
d15c8bc
Reinitialize entire compiler on `load_crate()`
rinon Mar 30, 2019
aa06aed
Handle variadic functions during retyping
rinon Mar 30, 2019
b04e44c
Merge branch 'master' into feature/nightly-2019-03-13
rinon Apr 8, 2019
15048f2
Update rustc version in common.py
rinon Apr 8, 2019
d01e4c0
Unconditionally emit dependency on libc in Cargo.toml
thedataking Mar 13, 2019
3c5e47d
Emit rust-toolchain file until c_variadics feature is stabilized
thedataking Mar 13, 2019
aa5743a
Conditionally emit rust-toolchain and feature flag for c variadics
thedataking Mar 13, 2019
0a3e98e
Revert "Unconditionally emit dependency on libc in Cargo.toml"
thedataking Mar 13, 2019
a3b43ab
Conditionally emit c_variadics feature
thedataking Mar 13, 2019
5e65ce2
Revert "Revert "Unconditionally emit dependency on libc in Cargo.toml""
thedataking Mar 13, 2019
fdb994d
Silence variadic function warning in AstExporter.cpp
thedataking Mar 13, 2019
1bee92e
Emit variadic Rust function signatures
thedataking Mar 13, 2019
e5abbea
Fix version of libc dependency; stop emitting libc feature
thedataking Mar 13, 2019
098255d
Remove libc feature from lib.rs template
thedataking Mar 13, 2019
b9917eb
Update known limitations
thedataking Mar 14, 2019
c19943f
Emit calls to raw_copy and raw_end for copied va_lists
thedataking Mar 22, 2019
ef1261f
Add function context to track information related to variadic argumen…
thedataking Mar 23, 2019
db6a5c9
Translate va_copy as function returning a VaList
thedataking Mar 24, 2019
b471393
Improve comment re. statement expressions
thedataking Mar 25, 2019
b7204f9
Update calls to va_list, stop calling va_end
thedataking Mar 26, 2019
fdeb7f8
Work around https://github.com/rust-lang/rust/issues/54482 when trans…
thedataking Mar 26, 2019
8a2299a
call set_feature for c_variadics
thedataking Mar 26, 2019
04229a2
fix typo in prev commit
thedataking Mar 26, 2019
2f3d727
Emit template build.rs
thedataking Mar 26, 2019
a133ddd
Emit error message when encountering unsupported, indirect gotos
thedataking Mar 27, 2019
54afb32
Clean up transpiler error messages
thedataking Mar 27, 2019
0e4394d
Update rust nightly version
thedataking Mar 27, 2019
ff53cee
Emit calls to va_end intrinsic
thedataking Mar 29, 2019
e1572fe
Rename panic to panic_or_err and introduce 'real' panic function
thedataking Mar 29, 2019
c1acd9f
Resolve field names in bitfield_zero_initializer
thedataking Mar 30, 2019
7b02c22
Request 2018 edition in Cargo.toml template
thedataking Mar 30, 2019
6d48244
Improve handling of variadic functions and functions with va_list arg…
thedataking Apr 2, 2019
6d3422d
Cleanup and simplify last commit
thedataking Apr 2, 2019
3f36a9b
Merge branch 'variadics_with_refactoring' into feature/nightly-2019-0…
rinon Apr 8, 2019
defb74a
Update test Cargo.toml files to include a libc dependency
rinon Apr 8, 2019
aac547b
Merge branch 'master' into feature/nightly-2019-03-13
rinon Apr 9, 2019
50889af
Merge branch 'master' into feature/nightly-2019-03-13
rinon Apr 9, 2019
f706876
Update to nightly-2019-04-08
rinon Apr 10, 2019
4313b23
Merge branch 'master' into feature/nightly-2019-03-13
rinon Apr 10, 2019
cd65682
Merge branch 'master' into feature/nightly-2019-03-13
rinon Apr 10, 2019
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
Prev Previous commit
Next Next commit
Cleanup and simplify last commit
thedataking authored and rinon committed Apr 8, 2019
commit 6d3422d10b4e72895f65901ae6cf6378cc6cdba7
35 changes: 25 additions & 10 deletions c2rust-transpile/src/translator/mod.rs
Original file line number Diff line number Diff line change
@@ -1270,6 +1270,28 @@ impl<'c> Translation<'c> {
}
}

/// Returns true iff type is a (pointer to)* the `va_list` structure type.
/// Note: the logic is based on `TypeConverter::convert_pointer`.
pub fn is_inner_type_valist(
ctxt: &TypedAstContext,
qtype: CQualTypeId
) -> bool {
match ctxt.resolve_type(qtype.ctype).kind {
CTypeKind::Struct(struct_id) => {
if let CDeclKind::Struct { name: Some(ref struct_name), .. } = ctxt[struct_id].kind {
if struct_name == "__va_list_tag" {
return true;
}
}
false
},
CTypeKind::Pointer(pointer_id) => {
Self::is_inner_type_valist(ctxt, pointer_id)
},
_ => false,
}
}

fn convert_function(
&self,
ctx: ExprContext,
@@ -1289,16 +1311,9 @@ impl<'c> Translation<'c> {

self.function_context.borrow_mut().enter_new(name);


let is_valist: bool = if arguments.len() > 0 {
let mut found = false;
for &(_decl_id, ref _var, typ) in arguments {
if TypeConverter::is_inner_type_valist(&self.ast_context, typ) {
found = true;
}
}
found
} else { false };
let is_valist: bool = arguments
.iter()
.any(|&(_, _, typ)| Self::is_inner_type_valist(&self.ast_context, typ));
if is_variadic || is_valist {
if let Some(body_id) = body {
if !self.is_well_formed_variadic(body_id) {