summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-02-16 18:40:36 +0000
committerDevang Patel <dpatel@apple.com>2011-02-16 18:40:36 +0000
commit1728c232d5e0de822c81c5b7e5e8b17027dfd603 (patch)
tree0b010b285a59ece8b0e067237c30d3501e67276c /clang/lib
parent4b22e7e67a24f08abd3cfd5528c42f3bc6f9b7c6 (diff)
downloadbcm5719-llvm-1728c232d5e0de822c81c5b7e5e8b17027dfd603.tar.gz
bcm5719-llvm-1728c232d5e0de822c81c5b7e5e8b17027dfd603.zip
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.
llvm-svn: 125672
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 9296b42e77d..956c3587430 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -161,7 +161,7 @@ llvm::DIFile CGDebugInfo::getOrCreateFile(SourceLocation Loc) {
SourceManager &SM = CGM.getContext().getSourceManager();
PresumedLoc PLoc = SM.getPresumedLoc(Loc);
- if (PLoc.isInvalid())
+ if (PLoc.isInvalid() || llvm::StringRef(PLoc.getFilename()).empty())
// If the location is not valid then use main input file.
return DBuilder.CreateFile(TheCU.getFilename(), TheCU.getDirectory());
OpenPOWER on IntegriCloud