diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-09-28 13:51:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 13:51:39 +0200 |
commit | 50b6f6996ab604931d8ee7ca2a26bfdce5559933 (patch) | |
tree | 2c17276e270016cad4fb002d80758fbfa9b272bb /lib | |
parent | 453167a41e4d3b75e14d9102779dc2311672d13f (diff) | |
download | Nim-50b6f6996ab604931d8ee7ca2a26bfdce5559933.tar.gz |
.noalias annotation; frontend support (#15419)
* .noalias annotation; frontend support * added .noalias support to Nim; implements https://github.com/nim-lang/RFCs/issues/204
Diffstat (limited to 'lib')
-rw-r--r-- | lib/impure/nre.nim | 2 | ||||
-rw-r--r-- | lib/nimbase.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 71936bd5f..12ea7ab56 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -386,7 +386,7 @@ func `[]`*(pattern: Captures, name: string): string = template toTableImpl() {.dirty.} = for key in RegexMatch(pattern).pattern.captureNameId.keys: if key in pattern: - result[key] = pattern[key] + result[key] = pattern[key] func toTable*(pattern: Captures): Table[string, string] = result = initTable[string, string]() diff --git a/lib/nimbase.h b/lib/nimbase.h index e43492b76..daae47d65 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -588,4 +588,7 @@ NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "" #endif #endif +#define NIM_NOALIAS __restrict +/* __restrict is said to work for all the C(++) compilers out there that we support */ + #endif /* NIMBASE_H */ |