llvm/clang-tools-extra/clang-include-fixer/plugin/IncludeFixerPlugin.cpp

//===- IncludeFixerPlugin.cpp - clang-include-fixer as a clang plugin -----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "../IncludeFixer.h"
#include "../YamlSymbolIndex.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Parse/ParseAST.h"
#include "clang/Sema/Sema.h"
#include "llvm/Support/Path.h"

namespace clang {
namespace include_fixer {

/// The core include fixer plugin action. This just provides the AST consumer
/// and command line flag parsing for using include fixer as a clang plugin.
class ClangIncludeFixerPluginAction : public PluginASTAction {};
} // namespace include_fixer
} // namespace clang

// This anchor is used to force the linker to link in the generated object file
// and thus register the include fixer plugin.
volatile int ClangIncludeFixerPluginAnchorSource =;

static clang::FrontendPluginRegistry::Add<
    clang::include_fixer::ClangIncludeFixerPluginAction>
    X("clang-include-fixer", "clang-include-fixer");