Index: tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp |
diff --git a/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp b/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp |
index fe9d860730a82b8c77ee3a3f9b0fb8ee66178198..e11d5f9299e6d74be4ea3ace7463bb4c3b6540ee 100644 |
--- a/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp |
+++ b/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp |
@@ -22,6 +22,7 @@ |
#include "clang/Tooling/Refactoring.h" |
#include "clang/Tooling/Tooling.h" |
#include "llvm/Support/CommandLine.h" |
+#include "llvm/support/TargetSelect.h" |
using namespace clang::ast_matchers; |
using clang::tooling::CommonOptionsParser; |
@@ -255,6 +256,10 @@ void MacroRewriterCallback::run(const MatchFinder::MatchResult& result) { |
static llvm::cl::extrahelp common_help(CommonOptionsParser::HelpMessage); |
int main(int argc, const char* argv[]) { |
+ // TODO(dcheng): Clang tooling should do this itself. |
+ // http://llvm.org/bugs/show_bug.cgi?id=21627 |
+ llvm::InitializeNativeTarget(); |
+ llvm::InitializeNativeTargetAsmParser(); |
llvm::cl::OptionCategory category("Remove scoped_refptr conversions"); |
CommonOptionsParser options(argc, argv, category); |
clang::tooling::ClangTool tool(options.getCompilations(), |