From 078037ab9b410fa13a86eabdfc30918fc83cdcf3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 11 Mar 2022 00:04:42 -0700 Subject: stage2: passing threadlocal tests for x86_64-linux * use the real start code for LLVM backend with x86_64-linux - there is still a check for zig_backend after initializing the TLS area to skip some stuff. * introduce new AIR instructions and implement them for the LLVM backend. They are the same as `call` except with a modifier. - call_always_tail - call_never_tail - call_never_inline * LLVM backend calls hasRuntimeBitsIgnoringComptime in more places to avoid unnecessarily depending on comptimeOnly being resolved for some types. * LLVM backend: remove duplicate code for setting linkage and value name. The canonical place for this is in `updateDeclExports`. * LLVM backend: do some assembly template massaging to make `%%` rendered as `%`. More hacks will be needed to make inline assembly catch up with stage1. --- src/Air.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Air.zig') diff --git a/src/Air.zig b/src/Air.zig index cf5bfad620..cc15113653 100644 --- a/src/Air.zig +++ b/src/Air.zig @@ -226,6 +226,12 @@ pub const Inst = struct { /// Uses the `pl_op` field with the `Call` payload. operand is the callee. /// Triggers `resolveTypeLayout` on the return type of the callee. call, + /// Same as `call` except with the `always_tail` attribute. + call_always_tail, + /// Same as `call` except with the `never_tail` attribute. + call_never_tail, + /// Same as `call` except with the `never_inline` attribute. + call_never_inline, /// Count leading zeroes of an integer according to its representation in twos complement. /// Result type will always be an unsigned integer big enough to fit the answer. /// Uses the `ty_op` field. @@ -969,7 +975,7 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type { .tag_name, .error_name => return Type.initTag(.const_slice_u8_sentinel_0), - .call => { + .call, .call_always_tail, .call_never_tail, .call_never_inline => { const callee_ty = air.typeOf(datas[inst].pl_op.operand); switch (callee_ty.zigTypeTag()) { .Fn => return callee_ty.fnReturnType(), -- cgit v1.2.3