2016-12-18 00:35:53 +03: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 04:58:56 +03:00
|
|
|
#include "DiagnosticsMatcher.h"
|
2017-10-20 20:11:50 +03:00
|
|
|
#include "plugin.h"
|
2016-12-29 19:32:31 +03:00
|
|
|
#include "clang/Frontend/FrontendPluginRegistry.h"
|
2016-12-18 00:35:53 +03:00
|
|
|
|
|
|
|
class MozCheckAction : public PluginASTAction {
|
|
|
|
public:
|
|
|
|
ASTConsumerPtr CreateASTConsumer(CompilerInstance &CI,
|
|
|
|
StringRef FileName) override {
|
2017-10-20 20:11:50 +03:00
|
|
|
void *Buffer = CI.getASTContext().Allocate<DiagnosticsMatcher>();
|
|
|
|
auto Matcher = new (Buffer) DiagnosticsMatcher(CI);
|
2016-12-19 04:58:56 +03:00
|
|
|
return Matcher->makeASTConsumer();
|
2016-12-18 00:35:53 +03: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-26 00:21:36 +03:00
|
|
|
|
|
|
|
DenseMap<unsigned, bool> InThirdPartyPathCache;
|