Carlos =?utf-8?q?Gálvez?= <carlos.gal...@zenseact.com>,
Carlos =?utf-8?q?Gálvez?= <carlos.gal...@zenseact.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/128...@github.com>


================
@@ -449,6 +479,10 @@ ClangTidyASTConsumerFactory::createASTConsumer(
   }
 
   std::vector<std::unique_ptr<ASTConsumer>> Consumers;
+
+  if (!Context.getOptions().SystemHeaders.value_or(false))
+    Consumers.push_back(std::make_unique<IgnoreSystemHeadersConsumer>());
+
   if (!Checks.empty())
     Consumers.push_back(Finder->newASTConsumer());
----------------
carlosgalvezp wrote:

Hmm, this code does not compile? `IgnoreSystemHeadersConsumer` does not have a 
constructor accepting a `unique_ptr<ASTConsumer>`?

There's also duplication in creating the `Finder->newASTConsumer()`, so I don't 
see how this solution would be preferable. I can certainly move the 
`IgnoreSystemHeadersConsumer` inside the `if(!Checks.empty())` though.

https://github.com/llvm/llvm-project/pull/128150
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to