summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/tools/lldb-instr/CMakeLists.txt1
-rw-r--r--lldb/tools/lldb-instr/Instrument.cpp8
2 files changed, 8 insertions, 1 deletions
diff --git a/lldb/tools/lldb-instr/CMakeLists.txt b/lldb/tools/lldb-instr/CMakeLists.txt
index 31776e5a166..e3dbeba4006 100644
--- a/lldb/tools/lldb-instr/CMakeLists.txt
+++ b/lldb/tools/lldb-instr/CMakeLists.txt
@@ -4,6 +4,7 @@ add_lldb_tool(lldb-instr
LINK_LIBS
clangAST
clangBasic
+ clangCodeGen
clangFrontend
clangLex
clangRewrite
diff --git a/lldb/tools/lldb-instr/Instrument.cpp b/lldb/tools/lldb-instr/Instrument.cpp
index a2850f5461b..cbc28423375 100644
--- a/lldb/tools/lldb-instr/Instrument.cpp
+++ b/lldb/tools/lldb-instr/Instrument.cpp
@@ -1,6 +1,7 @@
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
@@ -280,6 +281,11 @@ int main(int argc, const char **argv) {
CommonOptionsParser OP(argc, argv, InstrCategory,
"Utility for generating the macros for LLDB's "
"instrumentation framework.");
- ClangTool T(OP.getCompilations(), OP.getSourcePathList());
+
+ auto PCHOpts = std::make_shared<PCHContainerOperations>();
+ PCHOpts->registerWriter(llvm::make_unique<ObjectFilePCHContainerWriter>());
+ PCHOpts->registerReader(llvm::make_unique<ObjectFilePCHContainerReader>());
+
+ ClangTool T(OP.getCompilations(), OP.getSourcePathList(), PCHOpts);
return T.run(newFrontendActionFactory<SBAction>().get());
}
OpenPOWER on IntegriCloud