File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,11 @@ void HeaderIncludesCallback::FileSkipped(const FileEntryRef &SkippedFile, const
260
260
261
261
void HeaderIncludesJSONCallback::EndOfMainFile () {
262
262
OptionalFileEntryRef FE = SM.getFileEntryRefForID (SM.getMainFileID ());
263
- SmallString<256 > MainFile (FE->getName ());
264
- SM.getFileManager ().makeAbsolutePath (MainFile);
263
+ SmallString<256 > MainFile;
264
+ if (FE) {
265
+ MainFile += FE->getName ();
266
+ SM.getFileManager ().makeAbsolutePath (MainFile);
267
+ }
265
268
266
269
std::string Str;
267
270
llvm::raw_string_ostream OS (Str);
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -header-include-format=json -header-include-filtering=only-direct-system -header-include-file %t.txt -emit-module -x c -fmodules -fmodule-name=X %s -o /dev/null
2
+ module X {}
You can’t perform that action at this time.
0 commit comments