summaryrefslogtreecommitdiffstats
path: root/tools/libclang/CIndexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CIndexer.h')
-rw-r--r--tools/libclang/CIndexer.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/libclang/CIndexer.h b/tools/libclang/CIndexer.h
index cb7c62e..8a306cd 100644
--- a/tools/libclang/CIndexer.h
+++ b/tools/libclang/CIndexer.h
@@ -16,6 +16,8 @@
#define LLVM_CLANG_TOOLS_LIBCLANG_CINDEXER_H
#include "clang-c/Index.h"
+#include "clang/Frontend/PCHContainerOperations.h"
+#include "clang/Lex/ModuleLoader.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include <vector>
@@ -38,11 +40,14 @@ class CIndexer {
unsigned Options; // CXGlobalOptFlags.
std::string ResourcesPath;
+ std::shared_ptr<PCHContainerOperations> PCHContainerOps;
public:
- CIndexer() : OnlyLocalDecls(false), DisplayDiagnostics(false),
- Options(CXGlobalOpt_None) { }
-
+ CIndexer(std::shared_ptr<PCHContainerOperations> PCHContainerOps =
+ std::make_shared<RawPCHContainerOperations>())
+ : OnlyLocalDecls(false), DisplayDiagnostics(false),
+ Options(CXGlobalOpt_None), PCHContainerOps(PCHContainerOps) {}
+
/// \brief Whether we only want to see "local" declarations (that did not
/// come from a previous precompiled header). If false, we want to see all
/// declarations.
@@ -54,6 +59,10 @@ public:
DisplayDiagnostics = Display;
}
+ std::shared_ptr<PCHContainerOperations> getPCHContainerOperations() const {
+ return PCHContainerOps;
+ }
+
unsigned getCXGlobalOptFlags() const { return Options; }
void setCXGlobalOptFlags(unsigned options) { Options = options; }
OpenPOWER on IntegriCloud