summary refs log tree commit diff stats
path: root/compiler/msgs.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-02-22 16:27:52 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-02-22 16:27:52 +0100
commit46efaf294bfc230d0259d89fd0fbd7f1418b7ac4 (patch)
tree0b2d4c3970fe65b0ae41bebf33f555b2ccc537da /compiler/msgs.nim
parent311253ef2ffd63716ee69f4fd156462df26ae186 (diff)
downloadNim-46efaf294bfc230d0259d89fd0fbd7f1418b7ac4.tar.gz
big compiler refactoring; avoid globals for multi method dispatcher generation
Diffstat (limited to 'compiler/msgs.nim')
-rw-r--r--compiler/msgs.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 49e4fa184..a1ba82263 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -567,6 +567,15 @@ proc newFileInfo(fullPath, projPath: string): TFileInfo =
   if optEmbedOrigSrc in gGlobalOptions or true:
     result.lines = @[]
 
+proc fileInfoKnown*(filename: string): bool =
+  var
+    canon: string
+  try:
+    canon = canonicalizePath(filename)
+  except:
+    canon = filename
+  result = filenameToIndexTbl.hasKey(canon)
+
 proc fileInfoIdx*(filename: string; isKnownFile: var bool): int32 =
   var
     canon: string