 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
100.0% |
8 / 8 |
| |
 |
|
 |
1 : //===- CIndexer.h - Clang-C Source Indexing Library -----------------------===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 : //
10 : // This file defines CIndexer, a subclass of Indexer that provides extra
11 : // functionality needed by the CIndex library.
12 : //
13 : //===----------------------------------------------------------------------===//
14 :
15 : #ifndef LLVM_CLANG_CINDEXER_H
16 : #define LLVM_CLANG_CINDEXER_H
17 :
18 : #include "clang-c/Index.h"
19 : #include "clang/Frontend/CompilerInstance.h"
20 : #include "clang/Frontend/ASTUnit.h"
21 : #include "llvm/ADT/StringRef.h"
22 : #include "llvm/System/Path.h"
23 : #include <vector>
24 :
25 : using namespace clang;
26 :
27 54: class CIndexer {
28 : bool UseExternalASTGeneration;
29 : bool OnlyLocalDecls;
30 :
31 : llvm::sys::Path ClangPath;
32 :
33 : public:
34 69: CIndexer() : UseExternalASTGeneration(false), OnlyLocalDecls(false) { }
35 :
36 : /// \brief Whether we only want to see "local" declarations (that did not
37 : /// come from a previous precompiled header). If false, we want to see all
38 : /// declarations.
39 18: bool getOnlyLocalDecls() const { return OnlyLocalDecls; }
40 8: void setOnlyLocalDecls(bool Local = true) { OnlyLocalDecls = Local; }
41 :
42 10: bool getUseExternalASTGeneration() const { return UseExternalASTGeneration; }
43 1: void setUseExternalASTGeneration(bool Value) {
44 1: UseExternalASTGeneration = Value;
45 1: }
46 :
47 : /// \brief Get the path of the clang binary.
48 : const llvm::sys::Path& getClangPath();
49 :
50 : /// \brief Get the path of the clang resource files.
51 : std::string getClangResourcesPath();
52 :
53 : static CXString createCXString(const char *String, bool DupString = false);
54 : static CXString createCXString(llvm::StringRef String,
55 : bool DupString = false);
56 : };
57 :
58 : namespace clang {
59 : /**
60 : * \brief Given a set of "unsaved" files, create temporary files and
61 : * construct the clang -cc1 argument list needed to perform the remapping.
62 : *
63 : * \returns true if an error occurred.
64 : */
65 : bool RemapFiles(unsigned num_unsaved_files,
66 : struct CXUnsavedFile *unsaved_files,
67 : std::vector<std::string> &RemapArgs,
68 : std::vector<llvm::sys::Path> &TemporaryFiles);
69 : }
70 :
71 : #endif
Generated: 2010-02-10 01:31 by zcov