From 0781895e0f8359843b9215ac6ad16925a46b2703 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 14 Apr 2020 07:00:48 +0200 Subject: pkg/compiler: refactor attribute handling Introduce common infrastructure for describing and parsing attribute instead of custom per-attribute code scattered across several locations. Change align attribute syntax from the weird align_N to align[N]. This also allows to use literal constants as N. Introduce notion of builtin constants. Currently we have only PTR_SIZE, which is needed to replace align_ptr with align[PTR_SIZE]. --- pkg/compiler/testdata/errors2.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/compiler/testdata/errors2.txt') diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index b862c4951..fb69c8c5f 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -63,6 +63,7 @@ use_sr { s3 s3 s4 s4 s6 s6 + s8 s8 sr1 sr1 sr2 sr2 sr5 sr5 @@ -116,6 +117,10 @@ s7 { f2 u0 } +s8 { + f1 int8 +} [align[7]] ### bad struct s8 alignment 7 (must be a sane power of 2) + u0 [ f len[f1, int32] ### len target f1 does not exist ] -- cgit mrf-deployment