Do not adjust the config in AST consumer
* Adjusting the config at this point seems to be too late, at least it does not seem have any effect * Rather use the CLI arguments
This commit is contained in:
parent
0d2f39a2b5
commit
8eb9e9ec27
|
@ -21,27 +21,6 @@ FrontendAction::CreateASTConsumer(clang::CompilerInstance &compilerInstance, llv
|
||||||
// propagate compiler instance to factory
|
// propagate compiler instance to factory
|
||||||
m_factory.setCompilerInstance(&compilerInstance);
|
m_factory.setCompilerInstance(&compilerInstance);
|
||||||
|
|
||||||
// configure frontent, preporocessor and language options
|
|
||||||
clang::FrontendOptions &frontendOpts = compilerInstance.getFrontendOpts();
|
|
||||||
clang::Preprocessor &pp = compilerInstance.getPreprocessor();
|
|
||||||
clang::LangOptions &lngOpts = compilerInstance.getLangOpts();
|
|
||||||
frontendOpts.SkipFunctionBodies = true;
|
|
||||||
pp.enableIncrementalProcessing(true);
|
|
||||||
pp.SetSuppressIncludeNotFoundError(true);
|
|
||||||
lngOpts.DelayedTemplateParsing = true;
|
|
||||||
|
|
||||||
// enable all extensions
|
|
||||||
lngOpts.MicrosoftExt = true;
|
|
||||||
lngOpts.DeclSpecKeyword = true;
|
|
||||||
lngOpts.DollarIdents = true;
|
|
||||||
lngOpts.CPlusPlus11 = true;
|
|
||||||
#if CLANG_VERSION_MAJOR == 3 && CLANG_VERSION_MINOR <= 5
|
|
||||||
lngOpts.CPlusPlus1y = true;
|
|
||||||
#else
|
|
||||||
lngOpts.CPlusPlus14 = true;
|
|
||||||
#endif
|
|
||||||
lngOpts.GNUMode = true;
|
|
||||||
|
|
||||||
// turn some errors into warnings
|
// turn some errors into warnings
|
||||||
compilerInstance.getDiagnostics().setClient(
|
compilerInstance.getDiagnostics().setClient(
|
||||||
new DiagConsumer(std::unique_ptr<clang::DiagnosticConsumer>(compilerInstance.getDiagnostics().takeClient())));
|
new DiagConsumer(std::unique_ptr<clang::DiagnosticConsumer>(compilerInstance.getDiagnostics().takeClient())));
|
||||||
|
|
Loading…
Reference in New Issue