summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
Commit message (Expand)AuthorAgeFilesLines
* refactoring: no inheritance for PType/PSym (#23403)Andreas Rumpf2024-03-141-1/+1
* propagate efWantStmt in semWhen (#23400)metagn2024-03-141-3/+4
* fix wrong subtype relation in tuples & infer some conversions (#23228)metagn2024-01-181-3/+15
* delay resolved procvar check for proc params + acknowledge unresolved statics...metagn2024-01-111-11/+24
* trigger range check with new type inference on nkIntLit [backport:1.6] (#23179)metagn2024-01-081-2/+1
* ambiguous identifier resolution (#23123)metagn2024-01-011-33/+76
* add switch, warning, and `bind` support for new generic injection behavior (#...metagn2023-12-221-2/+12
* allow replacing captured syms in macro calls in generics (#23091)metagn2023-12-181-2/+18
* Overloads passed to static proc parameters now convert to the desired… (#23...Jason Beetham2023-12-141-2/+2
* type refactoring: part 2 (#23059)Andreas Rumpf2023-12-131-8/+8
* Types: Refactorings; step 1 (#23055)Andreas Rumpf2023-12-121-16/+16
* forbides adding sons for `PType` (#23030)ringabout2023-12-041-2/+1
* fixes #22971; `inferGenericTypes` does not work with method call syntax (#22972)Pylgos2023-11-221-2/+2
* IC: progress and refactorings (#22961)Andreas Rumpf2023-11-201-3/+3
* fixes #22947; static integers in quote do [backport] (#22948)ringabout2023-11-181-1/+1
* fixes #22354; Wrong C++ codegen for default parameter values in ORC (#22819)ringabout2023-10-131-2/+2
* fixes #22753; Nimsuggest segfault with invalid assignment to table (#22781)ringabout2023-10-021-1/+1
* fixes #10542; suppresses varargs conversion warnings (#22757)ringabout2023-09-261-1/+2
* make expressions opt in to symchoices (#22716)metagn2023-09-181-52/+47
* Instantiates generics in the module that uses it (#22513)Juan M Gómez2023-09-091-1/+1
* resolve unambiguous enum symchoices from local scope, error on rest (#22606)metagn2023-09-031-1/+4
* unify explicit generic param semchecking in calls (#22618)metagn2023-09-011-4/+0
* Fix #22604: Make endsInNoReturn traverse the tree (#22612)SirOlaf2023-09-011-1/+0
* type annotations for variable tuple unpacking, better error messages (#22611)metagn2023-09-011-2/+4
* `initCandidate` and friends now return values (#22570)ringabout2023-08-281-2/+1
* fixes a strictdef ten years long vintage bug, which counts the same thing twi...ringabout2023-08-241-0/+1
* round out tuple unpacking assignment, support underscores (#22537)metagn2023-08-241-1/+32
* cascade tyFromExpr in type conversions in generic bodies (#22499)metagn2023-08-171-5/+7
* unpublic the sons field of PType; the precursor to PType refactorings (#22446)ringabout2023-08-111-1/+1
* `initNodeTable` and friends now return (#22444)ringabout2023-08-111-2/+1
* use strictdefs for compiler (#22365)ringabout2023-08-061-6/+15
* fix #20883 Unspecified generic on default value segfaults the compiler (#21172)Bung2023-08-041-0/+3
* Add experimental inferGenericTypes switch (#22317)SirOlaf2023-08-031-5/+5
* Open scope for defer (#22315)SirOlaf2023-07-221-0/+2
* fixes #19101; zero initialization union casts (#22185)ringabout2023-06-291-5/+0
* fix calls in generic bodies, delay typecheck when no overloads match (#22029)metagn2023-06-131-1/+4
* Remove Deprecated Nimfix (#22062)Juan Carlos2023-06-101-3/+1
* properly disallow unresolved generic proc values (#22005)metagn2023-06-051-1/+13
* fixes #21887; Type conversion on overloaded enum field does not always call (...ringabout2023-05-261-0/+3
* fixes #21863; Incorrect enum field access can cause internal error (#21886)ringabout2023-05-241-1/+1
* fix #21251 Compiler SIGSEGV when using SharedTable (#21876)Bung2023-05-231-0/+2
* fix #14254 (#21837)metagn2023-05-201-1/+3
* adds an experimental `mm:atomicArc` switch (#21798)ringabout2023-05-081-1/+1
* cheap fix for #10853 + better tuple subscript error message (#21767)metagn2023-05-021-1/+4
* handle quoted routine symbols and non symbols expressions as before (#21740)ringabout2023-04-281-2/+3
* refactoring in preparation for better, simpler name mangling that wor… (#21...Andreas Rumpf2023-04-241-5/+5
* alias syntax fixes, improvements and tests (#21671)metagn2023-04-221-7/+13
* warn on set types bigger than max size, default to 0..255 for int literals (#...metagn2023-04-171-14/+19
* fixes #21674; `lent` can be used in the fields or the cast type as a paramete...ringabout2023-04-181-1/+1
* set module symbol type to None instead of nil for discard check (#21657)metagn2023-04-131-0/+6
">TSystemOS), TInfoOS] = [ (name: "DOS", parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj", newLine: "\x0D\x0A", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".", exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "Windows", parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj", newLine: "\x0D\x0A", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".", exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "OS2", parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj", newLine: "\x0D\x0A", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".", exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "Linux", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "MorphOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "SkyOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Solaris", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Irix", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "NetBSD", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "FreeBSD", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "OpenBSD", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "AIX", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "PalmOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC}), (name: "QNX", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Amiga", parDir: "..", dllFrmt: "$1.library", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC}), (name: "Atari", parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: "", curDir: ".", exeExt: ".tpp", extSep: ".", props: {ospNeedsPIC}), (name: "Netware", parDir: "..", dllFrmt: "$1.nlm", altDirSep: "/", objExt: "", newLine: "\x0D\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: ".nlm", extSep: ".", props: {ospCaseInsensitive}), (name: "MacOS", parDir: "::", dllFrmt: "$1Lib", altDirSep: ":", objExt: ".o", newLine: "\x0D", pathSep: ",", dirSep: ":", scriptExt: "", curDir: ":", exeExt: "", extSep: ".", props: {ospCaseInsensitive}), (name: "MacOSX", parDir: "..", dllFrmt: "lib$1.dylib", altDirSep: ":", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), (name: "Haiku", parDir: "..", dllFrmt: "lib$1.so", altDirSep: ":", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), (name: "EcmaScript", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {}), (name: "NimrodVM", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".", props: {}), (name: "Standalone", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: ".elf", extSep: ".", props: {})] type TSystemCPU* = enum # Also add CPU for in initialization section and # alias conditionals to condsyms (end of module). cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64, cpuSparc, cpuVm, cpuIa64, cpuAmd64, cpuMips, cpuArm, cpuEcmaScript, cpuNimrodVM, cpuAVR type TEndian* = enum littleEndian, bigEndian TInfoCPU* = tuple[name: string, intSize: int, endian: TEndian, floatSize, bit: int] const EndianToStr*: array[TEndian, string] = ["littleEndian", "bigEndian"] CPU*: array[succ(low(TSystemCPU))..high(TSystemCPU), TInfoCPU] = [ (name: "i386", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (name: "m68k", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "alpha", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64), (name: "powerpc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "powerpc64", intSize: 64, endian: bigEndian, floatSize: 64,bit: 64), (name: "sparc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "vm", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (name: "ia64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64), (name: "amd64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64), (name: "mips", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "arm", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (name: "ecmascript", intSize: 32, endian: bigEndian,floatSize: 64,bit: 32), (name: "nimrodvm", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "avr", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16)] var targetCPU*, hostCPU*: TSystemCPU targetOS*, hostOS*: TSystemOS proc NameToOS*(name: string): TSystemOS proc NameToCPU*(name: string): TSystemCPU var IntSize*: int floatSize*: int PtrSize*: int tnl*: string # target newline proc setTarget*(o: TSystemOS, c: TSystemCPU) = assert(c != cpuNone) assert(o != osNone) #echo "new Target: OS: ", o, " CPU: ", c targetCPU = c targetOS = o intSize = cpu[c].intSize div 8 floatSize = cpu[c].floatSize div 8 ptrSize = cpu[c].bit div 8 tnl = os[o].newLine proc NameToOS(name: string): TSystemOS = for i in countup(succ(osNone), high(TSystemOS)): if cmpIgnoreStyle(name, OS[i].name) == 0: return i result = osNone proc NameToCPU(name: string): TSystemCPU = for i in countup(succ(cpuNone), high(TSystemCPU)): if cmpIgnoreStyle(name, CPU[i].name) == 0: return i result = cpuNone hostCPU = nameToCPU(system.hostCPU) hostOS = nameToOS(system.hostOS) setTarget(hostOS, hostCPU) # assume no cross-compiling