@@ -53,6 +53,7 @@ use ty::BindingMode;
53
53
use ty::CanonicalTy;
54
54
use util::nodemap::{DefIdSet, ItemLocalMap};
55
55
use util::nodemap::{FxHashMap, FxHashSet};
56
+ use rustc_target::spec::VaListKind;
56
57
use rustc_data_structures::accumulate_vec::AccumulateVec;
57
58
use rustc_data_structures::stable_hasher::{HashStable, hash_stable_hashmap,
58
59
StableHasher, StableHasherResult,
@@ -2694,6 +2695,34 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2694
2695
self.object_lifetime_defaults_map(id.owner)
2695
2696
.and_then(|map| map.get(&id.local_id).cloned())
2696
2697
}
2698
+
2699
+ pub fn va_list_types(&self) -> Vec<Ty<'tcx>> {
2700
+ match self.sess.target.target.options.va_list_kind {
2701
+ VaListKind::CharPtr | VaListKind::VoidPtr => {
2702
+ vec![self.mk_mut_ptr(self.types.i8)]
2703
+ }
2704
+ VaListKind::X86_64Abi => {
2705
+ vec![self.types.i32,
2706
+ self.types.i32,
2707
+ self.mk_mut_ptr(self.types.i8),
2708
+ self.mk_mut_ptr(self.types.i8)]
2709
+ }
2710
+ VaListKind::AArch64Abi => {
2711
+ vec![self.mk_mut_ptr(self.types.i8),
2712
+ self.mk_mut_ptr(self.types.i8),
2713
+ self.mk_mut_ptr(self.types.i8),
2714
+ self.types.i32,
2715
+ self.types.i32]
2716
+ }
2717
+ VaListKind::PowerPcAbi => {
2718
+ vec![self.types.i8,
2719
+ self.types.i8,
2720
+ self.types.i16,
2721
+ self.mk_mut_ptr(self.types.i8),
2722
+ self.mk_mut_ptr(self.types.i8)]
2723
+ }
2724
+ }
2725
+ }
2697
2726
}
2698
2727
2699
2728
pub trait InternAs<T: ?Sized, R> {
0 commit comments