forked from OSchip/llvm-project
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.
llvm-svn: 125672
This commit is contained in:
parent
4b22e7e67a
commit
1728c232d5
|
@ -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());
|
||||
|
||||
|
|
|
@ -19,3 +19,12 @@ dispatch_item_t LEGACY_dispatch_call(dispatch_queue_t dq,
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
// radar://9008853
|
||||
typedef struct P {
|
||||
int x;
|
||||
} PS;
|
||||
# 1 ""
|
||||
void foo() {
|
||||
PS p2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue