summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-20 22:15:25 +0200
committerAraq <rumpf_a@web.de>2014-04-20 22:15:25 +0200
commit407515993336f5e686f2c93c0fd05d189a5cad3c (patch)
tree77420f6ea342f1ef49a75f55794397a339bcfd7d /compiler/pragmas.nim
parentda7d6c844604e443c47fe0317e579d9d61e5fa3d (diff)
downloadNim-407515993336f5e686f2c93c0fd05d189a5cad3c.tar.gz
reintroduce thread analysis but disable it for backwards compatibility
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r--compiler/pragmas.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 4cc9c4197..db9fe7cbe 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -1,7 +1,7 @@
 #
 #
 #           The Nimrod Compiler
-#        (c) Copyright 2012 Andreas Rumpf
+#        (c) Copyright 2014 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -689,10 +689,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
           incl(sym.flags, sfProcvar)
           if sym.typ != nil: incl(sym.typ.flags, tfThread)
         of wGcSafe:
-          noVal(it)
-          if sym.kind != skType: incl(sym.flags, sfThread)
-          if sym.typ != nil: incl(sym.typ.flags, tfGcSafe)
-          else: invalidPragma(it)
+          if optThreadAnalysis in gGlobalOptions:
+            noVal(it)
+            if sym.kind != skType: incl(sym.flags, sfThread)
+            if sym.typ != nil: incl(sym.typ.flags, tfGcSafe)
+            else: invalidPragma(it)
         of wPacked:
           noVal(it)
           if sym.typ == nil: invalidPragma(it)