]> granicus.if.org Git - clang/commit
Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_a
authorAdrian Prantl <aprantl@apple.com>
Thu, 10 Apr 2014 23:21:53 +0000 (23:21 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 10 Apr 2014 23:21:53 +0000 (23:21 +0000)
commit9a7c2b4dfae18c6826c6e8caed450f39efdf3ab3
treeb6f9cc3a99dc0d8cfd25bf38a94fb86b78513aed
parentf31150259598511e7b061eb48758c2a64f02ffb3
Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_a
are not associated with any source lines.

Previously, if the Location of a Decl was empty, EmitFunctionStart would
just keep using CurLoc, which would sometimes be correct (e.g., thunks)
but in other cases would just point to a hilariously random location.

This patch fixes this by completely eliminating all uses of CurLoc from
EmitFunctionStart and rather have clients explicitly pass in a
SourceLocation for the function header and the function body.

rdar://problem/14985269

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205999 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGenCXX/globalinit-loc.cpp [new file with mode: 0644]