diff options
| author | Dan Robertson <dan@dlrobertson.com> | 2019-02-08 17:30:42 +0000 |
|---|---|---|
| committer | Dan Robertson <dan@dlrobertson.com> | 2019-02-27 10:21:54 -0500 |
| commit | 08bd4ff9987fc57215a2fe54c63da0e86d9e6fbf (patch) | |
| tree | 35f5410433d1af5e6eff929cc4c1750dc43c9595 /src/librustc_codegen_ssa | |
| parent | a618ad6335f7cb70005884542f0548ef29f23b7e (diff) | |
| download | rust-08bd4ff9987fc57215a2fe54c63da0e86d9e6fbf.tar.gz rust-08bd4ff9987fc57215a2fe54c63da0e86d9e6fbf.zip | |
Rename variadic to c_variadic
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/block.rs | 6 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/mir/mod.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 684dfac991b..627380ee38f 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -232,7 +232,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { &mut self, mut bx: Bx, ) { - if self.fn_ty.variadic { + if self.fn_ty.c_variadic { if let Some(va_list) = self.va_list_ref { bx.va_end(va_list.llval); } @@ -507,7 +507,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // The "spoofed" `VaList` added to a C-variadic functions signature // should not be included in the `extra_args` calculation. - let extra_args_start_idx = sig.inputs().len() - if sig.variadic { 1 } else { 0 }; + let extra_args_start_idx = sig.inputs().len() - if sig.c_variadic { 1 } else { 0 }; let extra_args = &args[extra_args_start_idx..]; let extra_args = extra_args.iter().map(|op_arg| { let op_ty = op_arg.ty(self.mir, bx.tcx()); @@ -695,7 +695,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // an "spoofed" `VaList`. This argument is ignored, but we need to // populate it with a dummy operand so that the users real arguments // are not overwritten. - let i = if sig.variadic && last_arg_idx.map(|x| x == i).unwrap_or(false) { + let i = if sig.c_variadic && last_arg_idx.map(|x| x == i).unwrap_or(false) { let layout = match self.cx.tcx().lang_items().va_list() { Some(did) => bx.cx().layout_of(bx.tcx().type_of(did)), None => bug!("`va_list` language item required for C-variadics"), diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs index 95cf8cfe2d0..dc77d4673cd 100644 --- a/src/librustc_codegen_ssa/mir/mod.rs +++ b/src/librustc_codegen_ssa/mir/mod.rs @@ -585,7 +585,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( indirect_operand.store(bx, tmp); tmp } else { - if fx.fn_ty.variadic && last_arg_idx.map(|idx| arg_index == idx).unwrap_or(false) { + if fx.fn_ty.c_variadic && last_arg_idx.map(|idx| arg_index == idx).unwrap_or(false) { let va_list_impl = match arg_decl.ty.ty_adt_def() { Some(adt) => adt.non_enum_variant(), None => bug!("`va_list` language item improperly constructed") |
