2016-12-17 21:35:53 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2016-12-19 01:58:56 +00:00
|
|
|
#include "DiagnosticsMatcher.h"
|
2017-10-20 17:11:50 +00:00
|
|
|
#include "plugin.h"
|
2016-12-29 16:32:31 +00:00
|
|
|
#include "clang/Frontend/FrontendPluginRegistry.h"
|
2016-12-17 21:35:53 +00:00
|
|
|
|
|
|
|
class MozCheckAction : public PluginASTAction {
|
|
|
|
public:
|
|
|
|
ASTConsumerPtr CreateASTConsumer(CompilerInstance &CI,
|
|
|
|
StringRef FileName) override {
|
2017-10-20 17:11:50 +00:00
|
|
|
void *Buffer = CI.getASTContext().Allocate<DiagnosticsMatcher>();
|
|
|
|
auto Matcher = new (Buffer) DiagnosticsMatcher(CI);
|
2016-12-19 01:58:56 +00:00
|
|
|
return Matcher->makeASTConsumer();
|
2016-12-17 21:35:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ParseArgs(const CompilerInstance &CI,
|
|
|
|
const std::vector<std::string> &Args) override {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static FrontendPluginRegistry::Add<MozCheckAction> X("moz-check",
|
|
|
|
"check moz action");
|
2018-10-25 21:21:36 +00:00
|
|
|
|
|
|
|
DenseMap<unsigned, bool> InThirdPartyPathCache;
|