Blame build/clang-plugin/MozCheckAction.cpp

Packit f0b94e
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit f0b94e
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit f0b94e
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit f0b94e
Packit f0b94e
#include "DiagnosticsMatcher.h"
Packit f0b94e
#include "plugin.h"
Packit f0b94e
#include "clang/Frontend/FrontendPluginRegistry.h"
Packit f0b94e
Packit f0b94e
class MozCheckAction : public PluginASTAction {
Packit f0b94e
public:
Packit f0b94e
  ASTConsumerPtr CreateASTConsumer(CompilerInstance &CI,
Packit f0b94e
                                   StringRef FileName) override {
Packit f0b94e
    void *Buffer = CI.getASTContext().Allocate<DiagnosticsMatcher>();
Packit f0b94e
    auto Matcher = new (Buffer) DiagnosticsMatcher(CI);
Packit f0b94e
    return Matcher->makeASTConsumer();
Packit f0b94e
  }
Packit f0b94e
Packit f0b94e
  bool ParseArgs(const CompilerInstance &CI,
Packit f0b94e
                 const std::vector<std::string> &Args) override {
Packit f0b94e
    return true;
Packit f0b94e
  }
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
static FrontendPluginRegistry::Add<MozCheckAction> X("moz-check",
Packit f0b94e
                                                     "check moz action");