Skip to content

Commit

Permalink
use old typeinfo generation for hot code reloading (#22518)
Browse files Browse the repository at this point in the history
* use old typeinfo generation for hot code reloading

* at least test hello world compilation on orc
  • Loading branch information
metagn committed Aug 20, 2023
1 parent c0ecdb0 commit a4781dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ proc genTypeInfoV2(m: BModule; t: PType; info: TLineInfo): Rope =
return prefixTI.rope & result & ")".rope

m.g.typeInfoMarkerV2[sig] = (str: result, owner: owner)
if m.compileToCpp:
if m.compileToCpp or m.hcrOn:
genTypeInfoV2OldImpl(m, t, origType, result, info)
else:
genTypeInfoV2Impl(m, t, origType, result, info)
Expand Down
7 changes: 5 additions & 2 deletions testament/categories.nim
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string, isOrc =
testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat)
testSpec r, makeTest("tests/dll/visibility.nim", options & " --threads:off" & rpath, cat)

if "boehm" notin options and not isOrc:
if "boehm" notin options:
# hcr tests

testSpec r, makeTest("tests/dll/nimhcr_basic.nim", options & " --threads:off --forceBuild --hotCodeReloading:on " & rpath, cat)
var basicHcrTest = makeTest("tests/dll/nimhcr_basic.nim", options & " --threads:off --forceBuild --hotCodeReloading:on " & rpath, cat)
# test segfaults for now but compiles:
if isOrc: basicHcrTest.spec.action = actionCompile
testSpec r, basicHcrTest

# force build required - see the comments in the .nim file for more details
var hcri = makeTest("tests/dll/nimhcr_integration.nim",
Expand Down
1 change: 1 addition & 0 deletions tests/dll/nimhcr_basic.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ discard """
Hello world
'''
"""
# for now orc only tests successful compilation

echo "Hello world"

0 comments on commit a4781dc

Please sign in to comment.