diff options
author | Devang Patel <dpatel@apple.com> | 2010-05-10 17:24:58 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-05-10 17:24:58 +0000 |
commit | b319adec49d7b2af0113dc323ce7bf5c23967df8 (patch) | |
tree | ad26bb2cf89deaa3459e1383c7598cc2693ceaa0 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 01fcdaa7f5329ee88e59f6e7d7e152436f68b306 (diff) | |
download | bcm5719-llvm-b319adec49d7b2af0113dc323ce7bf5c23967df8.tar.gz bcm5719-llvm-b319adec49d7b2af0113dc323ce7bf5c23967df8.zip |
If variable location is invalid then use current location.
This fixes radar 7959934.
llvm-svn: 103408
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index fff4d60cc1f..59b6b72ad52 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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; |