[all-commits] [llvm/llvm-project] d20e4a: [DebugInfo] Fix potential CU mismatch for attachRa...
DianQK via All-commits
all-commits at lists.llvm.org
Sat Oct 22 06:25:59 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d20e4a1d68aa8e14c4e524e4d4eeb4445acac401
https://github.com/llvm/llvm-project/commit/d20e4a1d68aa8e14c4e524e4d4eeb4445acac401
Author: DianQK <dianqk at dianqk.net>
Date: 2022-10-22 (Sat, 22 Oct 2022)
Changed paths:
M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
M llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
A llvm/test/DebugInfo/Generic/cross-cu-inlining-ranges.ll
Log Message:
-----------
[DebugInfo] Fix potential CU mismatch for attachRangesOrLowHighPC
When a CU attaches some ranges for a subprogram or an inlined code, the CU should be that of the subprogram/inlined code that was emitted.
If not, then these emitted ranges will use the incorrect base of the CU in `emitRangeList`.
A reproducible example is:
When linking these two LLVM IRs, dsymutil will report no mapping for range or inconsistent range data warnings.
`foo.swift`
```swift
import AppKit.NSLayoutConstraint
public class Foo {
public var c: Int {
get {
Int(NSLayoutConstraint().constant)
}
set {
}
}
}
```
`main.swift`
```swift
// no mapping for range
let f: Foo! = nil
// inconsistent range data
//let l: Foo = Foo()
```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D136039
More information about the All-commits
mailing list