summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-09-28 13:51:39 +0200
committerGitHub <noreply@github.com>2020-09-28 13:51:39 +0200
commit50b6f6996ab604931d8ee7ca2a26bfdce5559933 (patch)
tree2c17276e270016cad4fb002d80758fbfa9b272bb /lib
parent453167a41e4d3b75e14d9102779dc2311672d13f (diff)
downloadNim-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.nim2
-rw-r--r--lib/nimbase.h3
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 */