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.
- (getOrCreateRecordFwdDecl) In clang/tools/driver/driver.cpp, the line of a #include is attached to DW_AT_decl_file/DW_AT_decl_line of a forward declaration __va_list_tag deep in the included hierarchy.
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.