aboutsummaryrefslogtreecommitdiff
path: root/tools/clang-check/ClangCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/clang-check/ClangCheck.cpp')
-rw-r--r--tools/clang-check/ClangCheck.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/clang-check/ClangCheck.cpp b/tools/clang-check/ClangCheck.cpp
index 7992026a7ccf..2682e0fcd83f 100644
--- a/tools/clang-check/ClangCheck.cpp
+++ b/tools/clang-check/ClangCheck.cpp
@@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//
#include "clang/AST/ASTConsumer.h"
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/CompilerInstance.h"
@@ -29,6 +30,7 @@
#include "llvm/Option/OptTable.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/TargetSelect.h"
using namespace clang::driver;
using namespace clang::tooling;
@@ -149,9 +151,17 @@ public:
int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal();
+
+ // Initialize targets for clang module support.
+ llvm::InitializeAllTargets();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmPrinters();
+ llvm::InitializeAllAsmParsers();
+
CommonOptionsParser OptionsParser(argc, argv, ClangCheckCategory);
ClangTool Tool(OptionsParser.getCompilations(),
- OptionsParser.getSourcePathList());
+ OptionsParser.getSourcePathList(),
+ std::make_shared<clang::ObjectFilePCHContainerOperations>());
// Clear adjusters because -fsyntax-only is inserted by the default chain.
Tool.clearArgumentsAdjusters();