swift
07b60f1b - Derive the SILDebugScope for a variable declaration from its owning ASTScope.

Commit
2 years ago
Derive the SILDebugScope for a variable declaration from its owning ASTScope. The previous code made the assumption that the ASTScope for a variable declaration should be the one of the declaration's source location. That is not necessarily the case, in some cases it should be an ancestor scope. This patch introduces a map from ValueDecl -> ASTScope that is derived from querying each ASTScope for its locals, which matches also what happens in name lookup. This patch also fixes the nesting of SILDebugScopes created for guard statement bodies, which are incorrectly nested in the ASTScope hierarchy. rdar://108940570
Author
Committer
Parents
  • lib/SILGen
    • File
      SILGenFunction.cpp
    • File
      SILGenFunction.h
  • test
    • DebugInfo
      • File
        for-scope.swift
      • File
        guard-let-scope.swift
      • File
        guard-let-scope2.swift
      • File
        guard-let-scope3.swift
      • File
        if-let-scope.swift
      • File
        inlinescopes.swift
      • File
        let-scope.swift
      • File
        scopes.swift
      • File
        shadowed-arg.swift
    • Macros
      • File
        macro_expand_closure.swift
    • SILOptimizer
      • File
        capturepromotion-wrong-lexicalscope.swift