-
Notifications
You must be signed in to change notification settings - Fork 0
/
translationunit_flags_gen.go
169 lines (152 loc) · 7.45 KB
/
translationunit_flags_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package clang
// #include "./clang-c/Index.h"
// #include "go-clang.h"
import "C"
import "fmt"
/*
Flags that control the creation of translation units.
The enumerators in this enumeration type are meant to be bitwise
ORed together to specify which options should be used when
constructing the translation unit.
*/
type TranslationUnit_Flags uint32
const (
// Used to indicate that no special translation-unit options are needed.
TranslationUnit_None TranslationUnit_Flags = C.CXTranslationUnit_None
/*
Used to indicate that the parser should construct a "detailed"
preprocessing record, including all macro definitions and instantiations.
Constructing a detailed preprocessing record requires more memory
and time to parse, since the information contained in the record
is usually not retained. However, it can be useful for
applications that require more detailed information about the
behavior of the preprocessor.
*/
TranslationUnit_DetailedPreprocessingRecord = C.CXTranslationUnit_DetailedPreprocessingRecord
/*
Used to indicate that the translation unit is incomplete.
When a translation unit is considered "incomplete", semantic
analysis that is typically performed at the end of the
translation unit will be suppressed. For example, this suppresses
the completion of tentative declarations in C and of
instantiation of implicitly-instantiation function templates in
C++. This option is typically used when parsing a header with the
intent of producing a precompiled header.
*/
TranslationUnit_Incomplete = C.CXTranslationUnit_Incomplete
/*
Used to indicate that the translation unit should be built with an
implicit precompiled header for the preamble.
An implicit precompiled header is used as an optimization when a
particular translation unit is likely to be reparsed many times
when the sources aren't changing that often. In this case, an
implicit precompiled header will be built containing all of the
initial includes at the top of the main file (what we refer to as
the "preamble" of the file). In subsequent parses, if the
preamble or the files in it have not changed, \c
clang_reparseTranslationUnit() will re-use the implicit
precompiled header to improve parsing performance.
*/
TranslationUnit_PrecompiledPreamble = C.CXTranslationUnit_PrecompiledPreamble
/*
Used to indicate that the translation unit should cache some
code-completion results with each reparse of the source file.
Caching of code-completion results is a performance optimization that
introduces some overhead to reparsing but improves the performance of
code-completion operations.
*/
TranslationUnit_CacheCompletionResults = C.CXTranslationUnit_CacheCompletionResults
/*
Used to indicate that the translation unit will be serialized with
clang_saveTranslationUnit.
This option is typically used when parsing a header with the intent of
producing a precompiled header.
*/
TranslationUnit_ForSerialization = C.CXTranslationUnit_ForSerialization
/*
DEPRECATED: Enabled chained precompiled preambles in C++.
Note: this is a *temporary* option that is available only while
we are testing C++ precompiled preamble support. It is deprecated.
*/
TranslationUnit_CXXChainedPCH = C.CXTranslationUnit_CXXChainedPCH
/*
Used to indicate that function/method bodies should be skipped while
parsing.
This option can be used to search for declarations/definitions while
ignoring the usages.
*/
TranslationUnit_SkipFunctionBodies = C.CXTranslationUnit_SkipFunctionBodies
// Used to indicate that brief documentation comments should be included into the set of code completions returned from this translation unit.
TranslationUnit_IncludeBriefCommentsInCodeCompletion = C.CXTranslationUnit_IncludeBriefCommentsInCodeCompletion
// Used to indicate that the precompiled preamble should be created on the first parse. Otherwise it will be created on the first reparse. This trades runtime on the first parse (serializing the preamble takes time) for reduced runtime on the second parse (can now reuse the preamble).
TranslationUnit_CreatePreambleOnFirstParse = C.CXTranslationUnit_CreatePreambleOnFirstParse
/*
Do not stop processing when fatal errors are encountered.
When fatal errors are encountered while parsing a translation unit,
semantic analysis is typically stopped early when compiling code. A common
source for fatal errors are unresolvable include files. For the
purposes of an IDE, this is undesirable behavior and as much information
as possible should be reported. Use this flag to enable this behavior.
*/
TranslationUnit_KeepGoing = C.CXTranslationUnit_KeepGoing
// Sets the preprocessor in a mode for parsing a single file only.
TranslationUnit_SingleFileParse = C.CXTranslationUnit_SingleFileParse
/*
Used in combination with CXTranslationUnit_SkipFunctionBodies to
constrain the skipping of function bodies to the preamble.
The function bodies of the main file are not skipped.
*/
TranslationUnit_LimitSkipFunctionBodiesToPreamble = C.CXTranslationUnit_LimitSkipFunctionBodiesToPreamble
// Used to indicate that attributed types should be included in CXType.
TranslationUnit_IncludeAttributedTypes = C.CXTranslationUnit_IncludeAttributedTypes
// Used to indicate that implicit attributes should be visited.
TranslationUnit_VisitImplicitAttributes = C.CXTranslationUnit_VisitImplicitAttributes
/*
Used to indicate that non-errors from included files should be ignored.
If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from
included files anymore. This speeds up clang_getDiagnosticSetFromTU() for
the case where these warnings are not of interest, as for an IDE for
example, which typically shows only the diagnostics in the main file.
*/
TranslationUnit_IgnoreNonErrorsFromIncludedFiles = C.CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles
)
func (tuf TranslationUnit_Flags) Spelling() string {
switch tuf {
case TranslationUnit_None:
return "TranslationUnit=None"
case TranslationUnit_DetailedPreprocessingRecord:
return "TranslationUnit=DetailedPreprocessingRecord"
case TranslationUnit_Incomplete:
return "TranslationUnit=Incomplete"
case TranslationUnit_PrecompiledPreamble:
return "TranslationUnit=PrecompiledPreamble"
case TranslationUnit_CacheCompletionResults:
return "TranslationUnit=CacheCompletionResults"
case TranslationUnit_ForSerialization:
return "TranslationUnit=ForSerialization"
case TranslationUnit_CXXChainedPCH:
return "TranslationUnit=CXXChainedPCH"
case TranslationUnit_SkipFunctionBodies:
return "TranslationUnit=SkipFunctionBodies"
case TranslationUnit_IncludeBriefCommentsInCodeCompletion:
return "TranslationUnit=IncludeBriefCommentsInCodeCompletion"
case TranslationUnit_CreatePreambleOnFirstParse:
return "TranslationUnit=CreatePreambleOnFirstParse"
case TranslationUnit_KeepGoing:
return "TranslationUnit=KeepGoing"
case TranslationUnit_SingleFileParse:
return "TranslationUnit=SingleFileParse"
case TranslationUnit_LimitSkipFunctionBodiesToPreamble:
return "TranslationUnit=LimitSkipFunctionBodiesToPreamble"
case TranslationUnit_IncludeAttributedTypes:
return "TranslationUnit=IncludeAttributedTypes"
case TranslationUnit_VisitImplicitAttributes:
return "TranslationUnit=VisitImplicitAttributes"
case TranslationUnit_IgnoreNonErrorsFromIncludedFiles:
return "TranslationUnit=IgnoreNonErrorsFromIncludedFiles"
}
return fmt.Sprintf("TranslationUnit_Flags unknown %d", int(tuf))
}
func (tuf TranslationUnit_Flags) String() string {
return tuf.Spelling()
}