summary refs log tree commit diff stats
path: root/compiler/ast.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-04-23 02:24:09 -0700
committerGitHub <noreply@github.com>2020-04-23 11:24:09 +0200
commit66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (patch)
tree8675842299fe22ad237b06bb923a880789c9faa4 /compiler/ast.nim
parent5c534b2943145106db99212fb9bb75fde289b6f5 (diff)
downloadNim-66db9de714be7c2f4cf1f2fb0a0a99145baf6acb.tar.gz
CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks (#13926)
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper
* cleanups
* import sizeof at CT for {.completeType.}
* address comments; revert default enabling of -d:checkAbi for now
* mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor
* all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r--compiler/ast.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 110ee79e3..2e3169665 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -553,6 +553,9 @@ type
                            # If it has one, t.destructor is not nil.
     tfAcyclic # object type was annotated as .acyclic
     tfIncompleteStruct # treat this type as if it had sizeof(pointer)
+    tfCompleteStruct
+      # (for importc types); type is fully specified, allowing to compute
+      # sizeof, alignof, offsetof at CT
 
   TTypeFlags* = set[TTypeFlag]