[PATCH] D94391: CGDebugInfo: Drop Loc.isInvalid() special case from getLineNumber

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 13:05:54 PST 2021


MaskRay added a comment.

In D94391#2491178 <https://reviews.llvm.org/D94391#2491178>, @dblaikie wrote:

> Any particular bug you're trying to fix? (this looks like it changes the debug locations, so it would need tests)
>
> Not necessarily clear that these are better debug locations?

No particular bug. `CGDebugInfo::getLineNumber` returning CurLoc just looks strange. (The CurLoc may be far below (irrelevant) when getLineNumber is called.)

This patch is hopefully NFC. Dropping `CurLoc` from `getLineNumber(RD->getLocation().isValid() ? RD->getLocation() : CurLoc)` will cause a difference, which may reveal missing `SourceLocation` information in ObjC constructs.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94391/new/

https://reviews.llvm.org/D94391



More information about the cfe-commits mailing list