Skip to content

Commit e83135f

Browse files
committed
fix: Ignore includeNotFoundErrors in order to keep visiting the entire AST
With llvm 7.0.1 metadata generation may be interrupted by includeNotFound error. Since in 4.0.1 'includeNotFound' errors are ignored for some reason (even though the 'suppressIncludeNotFound' setting is false) here we set this explicitly in order to keep the same behavior
1 parent ca32d7b commit e83135f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ class MetaGenerationFrontendAction : public clang::ASTFrontendAction {
131131

132132
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance& Compiler, llvm::StringRef InFile) override
133133
{
134+
// Since in 4.0.1 'includeNotFound' errors are ignored for some reason
135+
// (even though the 'suppressIncludeNotFound' setting is false)
136+
// here we set this explicitly in order to keep the same behavior
137+
Compiler.getPreprocessor().SetSuppressIncludeNotFoundError(true);
138+
134139
return std::unique_ptr<clang::ASTConsumer>(new MetaGenerationConsumer(Compiler.getASTContext().getSourceManager(), Compiler.getPreprocessor().getHeaderSearchInfo()));
135140
}
136141
};

0 commit comments

Comments
 (0)