aboutsummaryrefslogtreecommitdiff
path: root/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
commitbb6f54833cda9197511678d078f7d95d8da6f27e (patch)
treedc91270d88d221f8533ded21a89efa1b08cbc42d /lib
parent9b7db6200d366e4964d63ae1f33c7b9d7b9831cb (diff)
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125672 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 9296b42e77..956c358743 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/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());