1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "DiagnosticsMatcher.h"
7 #include "clang/Frontend/FrontendPluginRegistry.h"
9 class MozCheckAction
: public PluginASTAction
{
11 ASTConsumerPtr
CreateASTConsumer(CompilerInstance
&CI
,
12 StringRef FileName
) override
{
13 void *Buffer
= CI
.getASTContext().Allocate
<DiagnosticsMatcher
>();
14 auto Matcher
= new (Buffer
) DiagnosticsMatcher(CI
);
15 return Matcher
->makeASTConsumer();
18 bool ParseArgs(const CompilerInstance
&CI
,
19 const std::vector
<std::string
> &Args
) override
{
24 static FrontendPluginRegistry::Add
<MozCheckAction
> X("moz-check",
27 DenseMap
<StringRef
, bool> InThirdPartyPathCache
;