aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-10 17:24:58 +0000
committerDevang Patel <dpatel@apple.com>2010-05-10 17:24:58 +0000
commit258cf2766859f706bcd231a48593fbb6a1a1d0fe (patch)
tree0ea7ac0b6dab83cc5bf44960a767b84884bcacdf /lib/CodeGen/CGDebugInfo.cpp
parent90556d43dc697a675eda81ed80f2f585662bca4d (diff)
If variable location is invalid then use current location.
This fixes radar 7959934. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index fff4d60cc1..59b6b72ad5 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1536,7 +1536,9 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
if (!PLoc.isInvalid())
Line = PLoc.getLine();
else
- Unit = llvm::DIFile();
+ // If variable location is invalid, use current location to find
+ // corresponding file info.
+ Unit = getOrCreateFile(CurLoc);
CharUnits offset = CGF->BlockDecls[VD];
llvm::SmallVector<llvm::Value *, 9> addr;