Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / build / clang-plugin / MozCheckAction.cpp
blob6ec8c92bd8888f3c211fdea59689235104e7ac58
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"
6 #include "plugin.h"
7 #include "clang/Frontend/FrontendPluginRegistry.h"
9 class MozCheckAction : public PluginASTAction {
10 public:
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 {
20 return true;
24 static FrontendPluginRegistry::Add<MozCheckAction> X("moz-check",
25 "check moz action");
27 DenseMap<StringRef, bool> InThirdPartyPathCache;