summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-03-21 21:01:58 +0000
committerAdrian Prantl <aprantl@apple.com>2014-03-21 21:01:58 +0000
commit631b3bcb22b9a21e0a0c7644c845e35761567138 (patch)
tree7e8b01cf665c77990559348a9df2ef369415c5db /lib/CodeGen/CGDebugInfo.cpp
parent70dde185c5b35b7a465294e60fd50059f144882b (diff)
downloadclang-631b3bcb22b9a21e0a0c7644c845e35761567138.tar.gz
clang-631b3bcb22b9a21e0a0c7644c845e35761567138.tar.bz2
clang-631b3bcb22b9a21e0a0c7644c845e35761567138.tar.xz
CGDebugInfo: At the end of EmitFunctionStart, Initialize PrevLoc to the
location that the next call emitLocation() would default to. Otherwise setLocation() may wrongly believe that the current source file didn't change, when in fact it did. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index cfc94430bd..1a3089a14b 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -2577,9 +2577,12 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
if (HasDecl)
DeclCache.insert(std::make_pair(D->getCanonicalDecl(), llvm::WeakVH(SP)));
- // Push function on region stack.
+ // Push the function onto the lexical block stack.
llvm::MDNode *SPN = SP;
LexicalBlockStack.push_back(SPN);
+ // Initialize PrevLoc to the location of the function header.
+ PrevLoc = Loc;
+
if (HasDecl)
RegionMap[D] = llvm::WeakVH(SP);
}