CGDebugInfo: Drop Loc.isInvalid() special case from getLineNumber
`getLineNumber()` picks CurLoc if the parameter is invalid. This appears to mainly work around missing SourceLocation information for some constructs, but sometimes adds unintended locations. * For `CodeGenObjC/debug-info-blocks.m`, `CurLoc` has been advanced to the closing brace. The debug line of `ImplicitVarParameter` is set to the line of `}` because this implicit parameter has an invalid `SourceLocation`. The debug line is a bit arbitrary - perhaps the location of `^{` is better. * The file/line of Clang synthesized `__va_list_tag` is arbitrarily attached a `#include` line. D94735 Drop the special case to make getLineNumber less magic and add CurLoc fallback in its callers instead. Tested with stage 2 -DCMAKE_BUILD_TYPE=Debug clang, byte identical. Reviewed By: #debug-info, aprantl Differential Revision: https://reviews.llvm.org/D94391
Loading
Please sign in to comment