summaryrefslogtreecommitdiffstats
path: root/tools/CIndex/CIndexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/CIndex/CIndexer.h')
-rw-r--r--tools/CIndex/CIndexer.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/tools/CIndex/CIndexer.h b/tools/CIndex/CIndexer.h
index 4f3cd8b..d01454f 100644
--- a/tools/CIndex/CIndexer.h
+++ b/tools/CIndex/CIndexer.h
@@ -16,13 +16,10 @@
#define LLVM_CLANG_CINDEXER_H
#include "clang-c/Index.h"
-#include "clang/Index/ASTLocation.h"
-#include "clang/Index/Indexer.h"
-#include "clang/Index/Program.h"
-#include "clang/Index/Utils.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/ASTUnit.h"
#include "llvm/System/Path.h"
+#include <vector>
using namespace clang;
@@ -34,7 +31,7 @@ public:
virtual void HandleDiagnostic(Diagnostic::Level, const DiagnosticInfo &) {}
};
-class CIndexer : public Indexer {
+class CIndexer {
DiagnosticOptions DiagOpts;
IgnoreDiagnosticsClient IgnoreDiagClient;
llvm::OwningPtr<Diagnostic> TextDiags;
@@ -46,16 +43,12 @@ class CIndexer : public Indexer {
llvm::sys::Path ClangPath;
public:
- explicit CIndexer(Program *prog) : Indexer(*prog),
- IgnoreDiags(&IgnoreDiagClient),
- UseExternalASTGeneration(false),
- OnlyLocalDecls(false),
- DisplayDiagnostics(false) {
+ CIndexer() : IgnoreDiags(&IgnoreDiagClient), UseExternalASTGeneration(false),
+ OnlyLocalDecls(false), DisplayDiagnostics(false)
+ {
TextDiags.reset(CompilerInstance::createDiagnostics(DiagOpts, 0, 0));
}
- virtual ~CIndexer() { delete &getProgram(); }
-
/// \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.
@@ -85,4 +78,17 @@ public:
static CXString createCXString(const char *String, bool DupString = false);
};
+namespace clang {
+ /**
+ * \brief Given a set of "unsaved" files, create temporary files and
+ * construct the clang -cc1 argument list needed to perform the remapping.
+ *
+ * \returns true if an error occurred.
+ */
+ bool RemapFiles(unsigned num_unsaved_files,
+ struct CXUnsavedFile *unsaved_files,
+ std::vector<std::string> &RemapArgs,
+ std::vector<llvm::sys::Path> &TemporaryFiles);
+}
+
#endif
OpenPOWER on IntegriCloud