projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6eb0b0a
)
Return early if FileID is invalid. NFC
author
Akira Hatanaka
<ahatanaka@apple.com>
Thu, 15 Dec 2022 05:28:02 +0000
(21:28 -0800)
committer
Akira Hatanaka
<ahatanaka@apple.com>
Thu, 15 Dec 2022 05:28:31 +0000
(21:28 -0800)
clang/lib/Frontend/HeaderIncludeGen.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Frontend/HeaderIncludeGen.cpp
b/clang/lib/Frontend/HeaderIncludeGen.cpp
index 30fe5c75b9ac3978b1eb40d77f44a8fb027ff4a5..2ab4809402645e6233fc04a698f3d0f996230d96 100644
(file)
--- a/
clang/lib/Frontend/HeaderIncludeGen.cpp
+++ b/
clang/lib/Frontend/HeaderIncludeGen.cpp
@@
-291,7
+291,8
@@
static bool shouldRecordNewFile(SrcMgr::CharacteristicKind NewFileType,
void HeaderIncludesJSONCallback::FileChanged(
SourceLocation Loc, FileChangeReason Reason,
SrcMgr::CharacteristicKind NewFileType, FileID PrevFID) {
- if (!shouldRecordNewFile(NewFileType, SM.getLocForStartOfFile(PrevFID), SM))
+ if (PrevFID.isInvalid() ||
+ !shouldRecordNewFile(NewFileType, SM.getLocForStartOfFile(PrevFID), SM))
return;
// Unless we are exiting a #include, make sure to skip ahead to the line the