mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 21:50:12 +01:00
This picks up a newer version of LLVM and the LLVM Bazel integration. The big change here is that we can configure the LLVM targets that are built, which allows us to dramatically reduce the build costs by focusing on a couple of CPUs for the time being. There are a few API updates needed as well. This also rotates the cache version so we start with a clean Bazel cache from here. Otherwise we'd potentially pay the cost of carrying around stale bits of LLVM endlessly.
25 lines
923 B
C++
25 lines
923 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "clang/Tooling/CommonOptionsParser.h"
|
|
#include "clang/Tooling/Refactoring.h"
|
|
#include "migrate_cpp/cpp_refactoring/fn_inserter.h"
|
|
|
|
namespace cam = ::clang::ast_matchers;
|
|
namespace ct = ::clang::tooling;
|
|
|
|
auto main(int argc, const char** argv) -> int {
|
|
llvm::cl::OptionCategory category("C++ refactoring options");
|
|
auto parser = ct::CommonOptionsParser::create(argc, argv, category);
|
|
ct::RefactoringTool tool(parser->getCompilations(),
|
|
parser->getSourcePathList());
|
|
|
|
// Set up AST matcher callbacks.
|
|
cam::MatchFinder finder;
|
|
Carbon::FnInserter fn_inserter(tool.getReplacements(), &finder);
|
|
|
|
return tool.runAndSave(
|
|
clang::tooling::newFrontendActionFactory(&finder).get());
|
|
}
|