borrow checking (#15282)
* refactoring: move procs to typeallowed.nim * frontend preparations for first class openArray support * prepare the code generator for first class openArray * code generation for first class openArray; WIP * code generation for open arrays, progress * added isViewType proc * preparations for borrow checking * added borrow checking to the front end
This commit is contained in:
parent
c49b88163c
commit
10988d4840
18 changed files with 554 additions and 311 deletions
|
|
@ -1243,8 +1243,11 @@ proc trackProc*(c: PContext; s: PSym, body: PNode) =
|
|||
effects[ensuresEffects] = ensuresSpec
|
||||
|
||||
var mutationInfo = MutationInfo()
|
||||
if strictFuncs in c.features and not t.hasSideEffect and t.hasDangerousAssign:
|
||||
t.hasSideEffect = mutatesNonVarParameters(s, body, mutationInfo)
|
||||
if {strictFuncs, views} * c.features != {}:
|
||||
var partitions = computeGraphPartitions(s, body)
|
||||
if not t.hasSideEffect and t.hasDangerousAssign:
|
||||
t.hasSideEffect = varpartitions.hasSideEffect(partitions, mutationInfo)
|
||||
checkBorrowedLocations(partitions, g.config)
|
||||
|
||||
if sfThread in s.flags and t.gcUnsafe:
|
||||
if optThreads in g.config.globalOptions and optThreadAnalysis in g.config.globalOptions:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue