clang  15.0.0git
FrontendOptions.h
Go to the documentation of this file.
1 //===- FrontendOptions.h ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
10 #define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
11 
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/MemoryBuffer.h"
19 #include <cassert>
20 #include <map>
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 namespace llvm {
26 
27 class MemoryBuffer;
28 
29 } // namespace llvm
30 
31 namespace clang {
32 
33 namespace frontend {
34 
35 enum ActionKind {
36  /// Parse ASTs and list Decl nodes.
38 
39  /// Parse ASTs and dump them.
41 
42  /// Parse ASTs and print them.
44 
45  /// Parse ASTs and view them in Graphviz.
47 
48  /// Dump the compiler configuration.
50 
51  /// Dump out raw tokens.
53 
54  /// Dump out preprocessed tokens.
56 
57  /// Emit a .s file.
59 
60  /// Emit a .bc file.
62 
63  /// Translate input source into HTML.
65 
66  /// Emit a .ll file.
68 
69  /// Generate LLVM IR, but do not emit anything.
71 
72  /// Generate machine code, but don't emit anything.
74 
75  /// Emit a .o file.
77 
78  // Extract API information
80 
81  /// Parse and apply any fixits to the source.
83 
84  /// Generate pre-compiled module from a module map.
86 
87  /// Generate pre-compiled module from a C++ module interface file.
89 
90  /// Generate pre-compiled module from a set of header files.
92 
93  /// Generate a C++20 header unit module from a header file.
95 
96  /// Generate pre-compiled header.
98 
99  /// Generate Interface Stub Files.
101 
102  /// Only execute frontend initialization.
104 
105  /// Dump information about a module file.
107 
108  /// Load and verify that a PCH file is usable.
110 
111  /// Parse and perform semantic analysis.
113 
114  /// Run a plugin action, \see ActionName.
116 
117  /// Print the "preamble" of the input file
119 
120  /// -E mode.
122 
123  /// Expand macros but not \#includes.
125 
126  /// ObjC->C Rewriter.
128 
129  /// Rewriter playground
131 
132  /// Run one or more source code analyses.
134 
135  /// Dump template instantiations
137 
138  /// Run migrator.
140 
141  /// Just lex, no output.
143 
144  /// Print the output of the dependency directives source minimizer.
146 };
147 
148 } // namespace frontend
149 
150 /// The kind of a file that we've been handed as an input.
151 class InputKind {
152 private:
153  Language Lang;
154  unsigned Fmt : 3;
155  unsigned Preprocessed : 1;
156  unsigned HeaderUnit : 3;
157  unsigned IsHeader : 1;
158 
159 public:
160  /// The input file format.
161  enum Format {
165  };
166 
167  // If we are building a header unit, what kind it is; this affects whether
168  // we look for the file in the user or system include search paths before
169  // flagging a missing input.
175  };
176 
178  bool PP = false, HeaderUnitKind HU = HeaderUnit_None,
179  bool HD = false)
180  : Lang(L), Fmt(F), Preprocessed(PP), HeaderUnit(HU), IsHeader(HD) {}
181 
182  Language getLanguage() const { return static_cast<Language>(Lang); }
183  Format getFormat() const { return static_cast<Format>(Fmt); }
185  return static_cast<HeaderUnitKind>(HeaderUnit);
186  }
187  bool isPreprocessed() const { return Preprocessed; }
188  bool isHeader() const { return IsHeader; }
189  bool isHeaderUnit() const { return HeaderUnit != HeaderUnit_None; }
190 
191  /// Is the input kind fully-unknown?
192  bool isUnknown() const { return Lang == Language::Unknown && Fmt == Source; }
193 
194  /// Is the language of the input some dialect of Objective-C?
195  bool isObjectiveC() const {
196  return Lang == Language::ObjC || Lang == Language::ObjCXX;
197  }
198 
200  return InputKind(getLanguage(), getFormat(), true, getHeaderUnitKind(),
201  isHeader());
202  }
203 
206  getHeaderUnitKind(), true);
207  }
208 
210  return InputKind(getLanguage(), getFormat(), isPreprocessed(), HU,
211  isHeader());
212  }
213 
216  isHeader());
217  }
218 };
219 
220 /// An input file for the front end.
222  /// The file name, or "-" to read from standard input.
223  std::string File;
224 
225  /// The input, if it comes from a buffer rather than a file. This object
226  /// does not own the buffer, and the caller is responsible for ensuring
227  /// that it outlives any users.
229 
230  /// The kind of input, e.g., C source, AST file, LLVM IR.
231  InputKind Kind;
232 
233  /// Whether we're dealing with a 'system' input (vs. a 'user' input).
234  bool IsSystem = false;
235 
236 public:
237  FrontendInputFile() = default;
238  FrontendInputFile(StringRef File, InputKind Kind, bool IsSystem = false)
239  : File(File.str()), Kind(Kind), IsSystem(IsSystem) {}
240  FrontendInputFile(llvm::MemoryBufferRef Buffer, InputKind Kind,
241  bool IsSystem = false)
242  : Buffer(Buffer), Kind(Kind), IsSystem(IsSystem) {}
243 
244  InputKind getKind() const { return Kind; }
245  bool isSystem() const { return IsSystem; }
246 
247  bool isEmpty() const { return File.empty() && Buffer == None; }
248  bool isFile() const { return !isBuffer(); }
249  bool isBuffer() const { return Buffer != None; }
250  bool isPreprocessed() const { return Kind.isPreprocessed(); }
251  bool isHeader() const { return Kind.isHeader(); }
253  return Kind.getHeaderUnitKind();
254  }
255 
256  StringRef getFile() const {
257  assert(isFile());
258  return File;
259  }
260 
261  llvm::MemoryBufferRef getBuffer() const {
262  assert(isBuffer());
263  return *Buffer;
264  }
265 };
266 
267 /// FrontendOptions - Options for controlling the behavior of the frontend.
269 public:
270  /// Disable memory freeing on exit.
271  unsigned DisableFree : 1;
272 
273  /// When generating PCH files, instruct the AST writer to create relocatable
274  /// PCH files.
275  unsigned RelocatablePCH : 1;
276 
277  /// Show the -help text.
278  unsigned ShowHelp : 1;
279 
280  /// Show frontend performance metrics and statistics.
281  unsigned ShowStats : 1;
282 
283  /// print the supported cpus for the current target
284  unsigned PrintSupportedCPUs : 1;
285 
286  /// Output time trace profile.
287  unsigned TimeTrace : 1;
288 
289  /// Show the -version text.
290  unsigned ShowVersion : 1;
291 
292  /// Apply fixes even if there are unfixable errors.
293  unsigned FixWhatYouCan : 1;
294 
295  /// Apply fixes only for warnings.
296  unsigned FixOnlyWarnings : 1;
297 
298  /// Apply fixes and recompile.
299  unsigned FixAndRecompile : 1;
300 
301  /// Apply fixes to temporary files.
302  unsigned FixToTemporaries : 1;
303 
304  /// Emit ARC errors even if the migrator can fix them.
306 
307  /// Skip over function bodies to speed up parsing in cases you do not need
308  /// them (e.g. with code completion).
309  unsigned SkipFunctionBodies : 1;
310 
311  /// Whether we can use the global module index if available.
312  unsigned UseGlobalModuleIndex : 1;
313 
314  /// Whether we can generate the global module index if needed.
316 
317  /// Whether we include declaration dumps in AST dumps.
318  unsigned ASTDumpDecls : 1;
319 
320  /// Whether we deserialize all decls when forming AST dumps.
321  unsigned ASTDumpAll : 1;
322 
323  /// Whether we include lookup table dumps in AST dumps.
324  unsigned ASTDumpLookups : 1;
325 
326  /// Whether we include declaration type dumps in AST dumps.
327  unsigned ASTDumpDeclTypes : 1;
328 
329  /// Whether we are performing an implicit module build.
331 
332  /// Whether to use a filesystem lock when building implicit modules.
334 
335  /// Whether we should embed all used files into the PCM file.
336  unsigned ModulesEmbedAllFiles : 1;
337 
338  /// Whether timestamps should be written to the produced PCH file.
339  unsigned IncludeTimestamps : 1;
340 
341  /// Should a temporary file be used during compilation.
342  unsigned UseTemporary : 1;
343 
344  /// When using -emit-module, treat the modulemap as a system module.
345  unsigned IsSystemModule : 1;
346 
347  /// Output (and read) PCM files regardless of compiler errors.
349 
351 
352  /// Specifies the output format of the AST.
354 
355  enum {
361 
362  enum {
364 
365  /// Enable migration to modern ObjC literals.
367 
368  /// Enable migration to modern ObjC subscripting.
370 
371  /// Enable migration to modern ObjC readonly property.
373 
374  /// Enable migration to modern ObjC readwrite property.
376 
377  /// Enable migration to modern ObjC property.
379 
380  /// Enable annotation of ObjCMethods of all kinds.
382 
383  /// Enable migration of ObjC methods to 'instancetype'.
385 
386  /// Enable migration to NS_ENUM/NS_OPTIONS macros.
388 
389  /// Enable migration to add conforming protocols.
391 
392  /// prefer 'atomic' property over 'nonatomic'.
394 
395  /// annotate property with NS_RETURNS_INNER_POINTER
397 
398  /// use NS_NONATOMIC_IOSONLY for property 'atomic' attribute
400 
401  /// Enable inferring NS_DESIGNATED_INITIALIZER for ObjC methods.
403 
404  /// Enable converting setter/getter expressions to property-dot syntx.
406 
414  };
417 
420 
421  /// The input kind, either specified via -x argument or deduced from the input
422  /// file name.
424 
425  /// The input files and their types.
427 
428  /// When the input is a module map, the original module map file from which
429  /// that map was inferred, if any (for umbrella modules).
431 
432  /// The output file, if any.
434 
435  /// If given, the new suffix for fix-it rewritten files.
437 
438  /// If given, filter dumped AST Decl nodes by this substring.
440 
441  /// If given, enable code completion at the provided location.
443 
444  /// The frontend action to perform.
446 
447  /// The name of the action to run when using a plugin action.
449 
450  // Currently this is only used as part of the `-extract-api` action.
451  /// The name of the product the input files belong too.
453 
454  /// Args to pass to the plugins
455  std::map<std::string, std::vector<std::string>> PluginArgs;
456 
457  /// The list of plugin actions to run in addition to the normal action.
458  std::vector<std::string> AddPluginActions;
459 
460  /// The list of plugins to load.
461  std::vector<std::string> Plugins;
462 
463  /// The list of module file extensions.
464  std::vector<std::shared_ptr<ModuleFileExtension>> ModuleFileExtensions;
465 
466  /// The list of module map files to load before processing the input.
467  std::vector<std::string> ModuleMapFiles;
468 
469  /// The list of additional prebuilt module files to load before
470  /// processing the input.
471  std::vector<std::string> ModuleFiles;
472 
473  /// The list of files to embed into the compiled module file.
474  std::vector<std::string> ModulesEmbedFiles;
475 
476  /// The list of AST files to merge.
477  std::vector<std::string> ASTMergeFiles;
478 
479  /// A list of arguments to forward to LLVM's option processing; this
480  /// should only be used for debugging and experimental features.
481  std::vector<std::string> LLVMArgs;
482 
483  /// File name of the file that will provide record layouts
484  /// (in the format produced by -fdump-record-layouts).
486 
487  /// Auxiliary triple for CUDA/HIP compilation.
489 
490  /// Auxiliary target CPU for CUDA/HIP compilation.
492 
493  /// Auxiliary target features for CUDA/HIP compilation.
495 
496  /// Filename to write statistics to.
498 
499  /// Minimum time granularity (in microseconds) traced by time profiler.
501 
502 public:
514 
515  /// getInputKindForExtension - Return the appropriate input kind for a file
516  /// extension. For example, "c" would return Language::C.
517  ///
518  /// \return The input kind for the extension, or Language::Unknown if the
519  /// extension is not recognized.
520  static InputKind getInputKindForExtension(StringRef Extension);
521 };
522 
523 } // namespace clang
524 
525 #endif // LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
clang::InputKind::HeaderUnitKind
HeaderUnitKind
Definition: FrontendOptions.h:170
clang::FrontendOptions::ModuleMapFiles
std::vector< std::string > ModuleMapFiles
The list of module map files to load before processing the input.
Definition: FrontendOptions.h:467
clang::InputKind::HeaderUnit_User
@ HeaderUnit_User
Definition: FrontendOptions.h:172
clang::FrontendOptions::AddPluginActions
std::vector< std::string > AddPluginActions
The list of plugin actions to run in addition to the normal action.
Definition: FrontendOptions.h:458
clang::FrontendOptions::FixAndRecompile
unsigned FixAndRecompile
Apply fixes and recompile.
Definition: FrontendOptions.h:299
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::FrontendOptions::ObjCMT_ReadonlyProperty
@ ObjCMT_ReadonlyProperty
Enable migration to modern ObjC readonly property.
Definition: FrontendOptions.h:372
clang::InputKind::isObjectiveC
bool isObjectiveC() const
Is the language of the input some dialect of Objective-C?
Definition: FrontendOptions.h:195
clang::InputKind::Format
Format
The input file format.
Definition: FrontendOptions.h:161
clang::frontend::EmitAssembly
@ EmitAssembly
Emit a .s file.
Definition: FrontendOptions.h:58
clang::FrontendOptions::ObjCMT_None
@ ObjCMT_None
Definition: FrontendOptions.h:363
clang::DeclaratorContext::File
@ File
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::InputKind::isHeaderUnit
bool isHeaderUnit() const
Definition: FrontendOptions.h:189
clang::frontend::GenerateHeaderModule
@ GenerateHeaderModule
Generate pre-compiled module from a set of header files.
Definition: FrontendOptions.h:91
clang::frontend::RewriteTest
@ RewriteTest
Rewriter playground.
Definition: FrontendOptions.h:130
clang::FrontendInputFile::getKind
InputKind getKind() const
Definition: FrontendOptions.h:244
clang::FrontendOptions::ProgramAction
frontend::ActionKind ProgramAction
The frontend action to perform.
Definition: FrontendOptions.h:445
clang::FrontendOptions::ShowStats
unsigned ShowStats
Show frontend performance metrics and statistics.
Definition: FrontendOptions.h:281
llvm::SmallVector
Definition: LLVM.h:38
clang::FrontendOptions::LLVMArgs
std::vector< std::string > LLVMArgs
A list of arguments to forward to LLVM's option processing; this should only be used for debugging an...
Definition: FrontendOptions.h:481
clang::FrontendOptions::PluginArgs
std::map< std::string, std::vector< std::string > > PluginArgs
Args to pass to the plugins.
Definition: FrontendOptions.h:455
clang::FrontendOptions::ARCMTAction
enum clang::FrontendOptions::@188 ARCMTAction
clang::FrontendOptions::SkipFunctionBodies
unsigned SkipFunctionBodies
Skip over function bodies to speed up parsing in cases you do not need them (e.g.
Definition: FrontendOptions.h:309
clang::FrontendOptions::ARCMTMigrateReportOut
std::string ARCMTMigrateReportOut
Definition: FrontendOptions.h:419
clang::frontend::ModuleFileInfo
@ ModuleFileInfo
Dump information about a module file.
Definition: FrontendOptions.h:106
clang::frontend::RunPreprocessorOnly
@ RunPreprocessorOnly
Just lex, no output.
Definition: FrontendOptions.h:142
clang::FrontendInputFile
An input file for the front end.
Definition: FrontendOptions.h:221
clang::InputKind::withHeaderUnit
InputKind withHeaderUnit(HeaderUnitKind HU) const
Definition: FrontendOptions.h:209
clang::ParsedSourceLocation
A source location that has been parsed on the command line.
Definition: CommandLineSourceLoc.h:24
llvm::Optional< llvm::MemoryBufferRef >
clang::FrontendOptions::TimeTraceGranularity
unsigned TimeTraceGranularity
Minimum time granularity (in microseconds) traced by time profiler.
Definition: FrontendOptions.h:500
clang::frontend::ASTDump
@ ASTDump
Parse ASTs and dump them.
Definition: FrontendOptions.h:40
clang::FrontendOptions::ObjCMT_ProtocolConformance
@ ObjCMT_ProtocolConformance
Enable migration to add conforming protocols.
Definition: FrontendOptions.h:390
clang::InputKind
The kind of a file that we've been handed as an input.
Definition: FrontendOptions.h:151
clang::frontend::VerifyPCH
@ VerifyPCH
Load and verify that a PCH file is usable.
Definition: FrontendOptions.h:109
clang::frontend::PluginAction
@ PluginAction
Run a plugin action,.
Definition: FrontendOptions.h:115
clang::frontend::RewriteObjC
@ RewriteObjC
ObjC->C Rewriter.
Definition: FrontendOptions.h:127
clang::InputKind::Source
@ Source
Definition: FrontendOptions.h:162
clang::FrontendOptions::AuxTargetFeatures
Optional< std::vector< std::string > > AuxTargetFeatures
Auxiliary target features for CUDA/HIP compilation.
Definition: FrontendOptions.h:494
clang::FrontendOptions::PrintSupportedCPUs
unsigned PrintSupportedCPUs
print the supported cpus for the current target
Definition: FrontendOptions.h:284
clang::FrontendInputFile::getFile
StringRef getFile() const
Definition: FrontendOptions.h:256
clang::FrontendOptions::ShowVersion
unsigned ShowVersion
Show the -version text.
Definition: FrontendOptions.h:290
clang::FrontendOptions::ObjCMT_MigrateAll
@ ObjCMT_MigrateAll
Definition: FrontendOptions.h:412
clang::FrontendOptions::Inputs
SmallVector< FrontendInputFile, 0 > Inputs
The input files and their types.
Definition: FrontendOptions.h:426
clang::frontend::GeneratePCH
@ GeneratePCH
Generate pre-compiled header.
Definition: FrontendOptions.h:97
clang::FrontendOptions::ProductName
std::string ProductName
The name of the product the input files belong too.
Definition: FrontendOptions.h:452
clang::FrontendOptions::OverrideRecordLayoutsFile
std::string OverrideRecordLayoutsFile
File name of the file that will provide record layouts (in the format produced by -fdump-record-layou...
Definition: FrontendOptions.h:485
clang::FrontendOptions::ModulesEmbedAllFiles
unsigned ModulesEmbedAllFiles
Whether we should embed all used files into the PCM file.
Definition: FrontendOptions.h:336
clang::FrontendOptions::ARCMT_Modify
@ ARCMT_Modify
Definition: FrontendOptions.h:358
clang::frontend::ASTView
@ ASTView
Parse ASTs and view them in Graphviz.
Definition: FrontendOptions.h:46
clang::FrontendOptions::ShowHelp
unsigned ShowHelp
Show the -help text.
Definition: FrontendOptions.h:278
clang::FrontendOptions::AuxTargetCPU
Optional< std::string > AuxTargetCPU
Auxiliary target CPU for CUDA/HIP compilation.
Definition: FrontendOptions.h:491
clang::FrontendOptions::ASTDumpFormat
ASTDumpOutputFormat ASTDumpFormat
Specifies the output format of the AST.
Definition: FrontendOptions.h:353
clang::frontend::ASTPrint
@ ASTPrint
Parse ASTs and print them.
Definition: FrontendOptions.h:43
clang::FrontendOptions::ObjCMT_Property
@ ObjCMT_Property
Enable migration to modern ObjC property.
Definition: FrontendOptions.h:378
clang::FrontendOptions::FrontendOptions
FrontendOptions()
Definition: FrontendOptions.h:503
clang::FrontendOptions::ASTDumpDecls
unsigned ASTDumpDecls
Whether we include declaration dumps in AST dumps.
Definition: FrontendOptions.h:318
clang::FrontendInputFile::FrontendInputFile
FrontendInputFile(StringRef File, InputKind Kind, bool IsSystem=false)
Definition: FrontendOptions.h:238
clang::FrontendInputFile::getBuffer
llvm::MemoryBufferRef getBuffer() const
Definition: FrontendOptions.h:261
clang::frontend::RunAnalysis
@ RunAnalysis
Run one or more source code analyses.
Definition: FrontendOptions.h:133
clang::frontend::EmitObj
@ EmitObj
Emit a .o file.
Definition: FrontendOptions.h:76
clang::FrontendOptions::getInputKindForExtension
static InputKind getInputKindForExtension(StringRef Extension)
getInputKindForExtension - Return the appropriate input kind for a file extension.
Definition: FrontendOptions.cpp:15
clang::frontend::ActionKind
ActionKind
Definition: FrontendOptions.h:35
CodeCompleteOptions.h
clang::FrontendOptions::UseTemporary
unsigned UseTemporary
Should a temporary file be used during compilation.
Definition: FrontendOptions.h:342
clang::FrontendOptions::OutputFile
std::string OutputFile
The output file, if any.
Definition: FrontendOptions.h:433
clang::FrontendOptions::ASTDumpFilter
std::string ASTDumpFilter
If given, filter dumped AST Decl nodes by this substring.
Definition: FrontendOptions.h:439
clang::FrontendOptions::AuxTriple
std::string AuxTriple
Auxiliary triple for CUDA/HIP compilation.
Definition: FrontendOptions.h:488
clang::FrontendInputFile::getHeaderUnitKind
InputKind::HeaderUnitKind getHeaderUnitKind() const
Definition: FrontendOptions.h:252
clang::frontend::ParseSyntaxOnly
@ ParseSyntaxOnly
Parse and perform semantic analysis.
Definition: FrontendOptions.h:112
clang::FrontendOptions::ObjCMT_Instancetype
@ ObjCMT_Instancetype
Enable migration of ObjC methods to 'instancetype'.
Definition: FrontendOptions.h:384
clang::ASTDumpOutputFormat
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
Definition: ASTDumperUtils.h:21
clang::FrontendOptions
FrontendOptions - Options for controlling the behavior of the frontend.
Definition: FrontendOptions.h:268
ASTDumperUtils.h
clang::frontend::ASTDeclList
@ ASTDeclList
Parse ASTs and list Decl nodes.
Definition: FrontendOptions.h:37
clang::InputKind::isUnknown
bool isUnknown() const
Is the input kind fully-unknown?
Definition: FrontendOptions.h:192
clang::InputKind::HeaderUnit_Abs
@ HeaderUnit_Abs
Definition: FrontendOptions.h:174
clang::InputKind::getHeader
InputKind getHeader() const
Definition: FrontendOptions.h:204
clang::frontend::DumpRawTokens
@ DumpRawTokens
Dump out raw tokens.
Definition: FrontendOptions.h:52
clang::InputKind::getLanguage
Language getLanguage() const
Definition: FrontendOptions.h:182
clang::frontend::EmitLLVM
@ EmitLLVM
Emit a .ll file.
Definition: FrontendOptions.h:67
clang::FrontendOptions::ASTDumpDeclTypes
unsigned ASTDumpDeclTypes
Whether we include declaration type dumps in AST dumps.
Definition: FrontendOptions.h:327
clang::FrontendInputFile::isBuffer
bool isBuffer() const
Definition: FrontendOptions.h:249
clang::InputKind::Precompiled
@ Precompiled
Definition: FrontendOptions.h:164
clang::FrontendOptions::StatsFile
std::string StatsFile
Filename to write statistics to.
Definition: FrontendOptions.h:497
clang::FrontendOptions::ASTDumpAll
unsigned ASTDumpAll
Whether we deserialize all decls when forming AST dumps.
Definition: FrontendOptions.h:321
clang::InputKind::getPreprocessed
InputKind getPreprocessed() const
Definition: FrontendOptions.h:199
clang::FrontendOptions::ObjCMTAction
unsigned ObjCMTAction
Definition: FrontendOptions.h:415
clang::FrontendInputFile::isFile
bool isFile() const
Definition: FrontendOptions.h:248
clang::FrontendOptions::FixToTemporaries
unsigned FixToTemporaries
Apply fixes to temporary files.
Definition: FrontendOptions.h:302
clang::frontend::PrintDependencyDirectivesSourceMinimizerOutput
@ PrintDependencyDirectivesSourceMinimizerOutput
Print the output of the dependency directives source minimizer.
Definition: FrontendOptions.h:145
clang::FrontendOptions::ASTMergeFiles
std::vector< std::string > ASTMergeFiles
The list of AST files to merge.
Definition: FrontendOptions.h:477
clang::FrontendOptions::ARCMT_Migrate
@ ARCMT_Migrate
Definition: FrontendOptions.h:359
clang::frontend::EmitHTML
@ EmitHTML
Translate input source into HTML.
Definition: FrontendOptions.h:64
clang::InputKind::isHeader
bool isHeader() const
Definition: FrontendOptions.h:188
clang::FrontendOptions::DashX
InputKind DashX
The input kind, either specified via -x argument or deduced from the input file name.
Definition: FrontendOptions.h:423
clang::frontend::RewriteMacros
@ RewriteMacros
Expand macros but not #includes.
Definition: FrontendOptions.h:124
clang::FrontendOptions::ModulesEmbedFiles
std::vector< std::string > ModulesEmbedFiles
The list of files to embed into the compiled module file.
Definition: FrontendOptions.h:474
clang::FrontendOptions::UseGlobalModuleIndex
unsigned UseGlobalModuleIndex
Whether we can use the global module index if available.
Definition: FrontendOptions.h:312
clang::FrontendOptions::AllowPCMWithCompilerErrors
unsigned AllowPCMWithCompilerErrors
Output (and read) PCM files regardless of compiler errors.
Definition: FrontendOptions.h:348
clang::FrontendOptions::ASTDumpLookups
unsigned ASTDumpLookups
Whether we include lookup table dumps in AST dumps.
Definition: FrontendOptions.h:324
clang::FrontendOptions::ARCMT_None
@ ARCMT_None
Definition: FrontendOptions.h:356
clang::FrontendOptions::ObjCMT_AtomicProperty
@ ObjCMT_AtomicProperty
prefer 'atomic' property over 'nonatomic'.
Definition: FrontendOptions.h:393
clang::FrontendOptions::FixOnlyWarnings
unsigned FixOnlyWarnings
Apply fixes only for warnings.
Definition: FrontendOptions.h:296
clang::FrontendOptions::ObjCMT_Annotation
@ ObjCMT_Annotation
Enable annotation of ObjCMethods of all kinds.
Definition: FrontendOptions.h:381
clang::InputKind::getFormat
Format getFormat() const
Definition: FrontendOptions.h:183
clang::FrontendInputFile::isSystem
bool isSystem() const
Definition: FrontendOptions.h:245
clang::FrontendOptions::ObjCMT_PropertyDotSyntax
@ ObjCMT_PropertyDotSyntax
Enable converting setter/getter expressions to property-dot syntx.
Definition: FrontendOptions.h:405
clang::FrontendOptions::ObjCMT_ReturnsInnerPointerProperty
@ ObjCMT_ReturnsInnerPointerProperty
annotate property with NS_RETURNS_INNER_POINTER
Definition: FrontendOptions.h:396
clang::FrontendInputFile::isHeader
bool isHeader() const
Definition: FrontendOptions.h:251
clang::FrontendOptions::TimeTrace
unsigned TimeTrace
Output time trace profile.
Definition: FrontendOptions.h:287
clang::FrontendOptions::ModuleFileExtensions
std::vector< std::shared_ptr< ModuleFileExtension > > ModuleFileExtensions
The list of module file extensions.
Definition: FrontendOptions.h:464
clang::InputKind::ModuleMap
@ ModuleMap
Definition: FrontendOptions.h:163
clang::frontend::EmitBC
@ EmitBC
Emit a .bc file.
Definition: FrontendOptions.h:61
clang::frontend::GenerateHeaderUnit
@ GenerateHeaderUnit
Generate a C++20 header unit module from a header file.
Definition: FrontendOptions.h:94
clang::FrontendInputFile::isPreprocessed
bool isPreprocessed() const
Definition: FrontendOptions.h:250
clang::InputKind::InputKind
constexpr InputKind(Language L=Language::Unknown, Format F=Source, bool PP=false, HeaderUnitKind HU=HeaderUnit_None, bool HD=false)
Definition: FrontendOptions.h:177
clang::FrontendOptions::CodeCompleteOpts
CodeCompleteOptions CodeCompleteOpts
Definition: FrontendOptions.h:350
false
#define false
Definition: stdbool.h:22
clang::Language
Language
The language for the input, used to select and validate the language standard and possible actions.
Definition: LangStandard.h:23
clang::FrontendOptions::IsSystemModule
unsigned IsSystemModule
When using -emit-module, treat the modulemap as a system module.
Definition: FrontendOptions.h:345
LangStandard.h
clang::frontend::GenerateModule
@ GenerateModule
Generate pre-compiled module from a module map.
Definition: FrontendOptions.h:85
clang::FrontendInputFile::FrontendInputFile
FrontendInputFile(llvm::MemoryBufferRef Buffer, InputKind Kind, bool IsSystem=false)
Definition: FrontendOptions.h:240
clang::FrontendOptions::FixItSuffix
std::string FixItSuffix
If given, the new suffix for fix-it rewritten files.
Definition: FrontendOptions.h:436
clang::Language::ObjCXX
@ ObjCXX
clang::frontend::FixIt
@ FixIt
Parse and apply any fixits to the source.
Definition: FrontendOptions.h:82
clang::FrontendOptions::Plugins
std::vector< std::string > Plugins
The list of plugins to load.
Definition: FrontendOptions.h:461
clang::frontend::ExtractAPI
@ ExtractAPI
Definition: FrontendOptions.h:79
clang::Language::ObjC
@ ObjC
clang::FrontendOptions::ActionName
std::string ActionName
The name of the action to run when using a plugin action.
Definition: FrontendOptions.h:448
clang::FrontendOptions::GenerateGlobalModuleIndex
unsigned GenerateGlobalModuleIndex
Whether we can generate the global module index if needed.
Definition: FrontendOptions.h:315
ModuleFileExtension.h
clang::FrontendOptions::ARCMT_Check
@ ARCMT_Check
Definition: FrontendOptions.h:357
clang::InputKind::HeaderUnit_None
@ HeaderUnit_None
Definition: FrontendOptions.h:171
clang::FrontendOptions::BuildingImplicitModule
unsigned BuildingImplicitModule
Whether we are performing an implicit module build.
Definition: FrontendOptions.h:330
clang::FrontendOptions::ARCMTMigrateEmitARCErrors
unsigned ARCMTMigrateEmitARCErrors
Emit ARC errors even if the migrator can fix them.
Definition: FrontendOptions.h:305
clang::FrontendInputFile::isEmpty
bool isEmpty() const
Definition: FrontendOptions.h:247
clang::FrontendOptions::ObjCMT_Subscripting
@ ObjCMT_Subscripting
Enable migration to modern ObjC subscripting.
Definition: FrontendOptions.h:369
clang::FrontendOptions::ObjCMT_ReadwriteProperty
@ ObjCMT_ReadwriteProperty
Enable migration to modern ObjC readwrite property.
Definition: FrontendOptions.h:375
clang::FrontendOptions::ModuleFiles
std::vector< std::string > ModuleFiles
The list of additional prebuilt module files to load before processing the input.
Definition: FrontendOptions.h:471
clang::FrontendOptions::OriginalModuleMap
std::string OriginalModuleMap
When the input is a module map, the original module map file from which that map was inferred,...
Definition: FrontendOptions.h:430
clang::FrontendOptions::ObjCMTAllowListPath
std::string ObjCMTAllowListPath
Definition: FrontendOptions.h:416
clang::FrontendOptions::ObjCMT_MigrateDecls
@ ObjCMT_MigrateDecls
Definition: FrontendOptions.h:407
clang
Definition: CalledOnceCheck.h:17
clang::frontend::DumpTokens
@ DumpTokens
Dump out preprocessed tokens.
Definition: FrontendOptions.h:55
clang::FrontendOptions::BuildingImplicitModuleUsesLock
unsigned BuildingImplicitModuleUsesLock
Whether to use a filesystem lock when building implicit modules.
Definition: FrontendOptions.h:333
clang::ADOF_Default
@ ADOF_Default
Definition: ASTDumperUtils.h:22
clang::InputKind::getHeaderUnitKind
HeaderUnitKind getHeaderUnitKind() const
Definition: FrontendOptions.h:184
clang::FrontendOptions::IncludeTimestamps
unsigned IncludeTimestamps
Whether timestamps should be written to the produced PCH file.
Definition: FrontendOptions.h:339
clang::frontend::DumpCompilerOptions
@ DumpCompilerOptions
Dump the compiler configuration.
Definition: FrontendOptions.h:49
clang::CodeCompleteOptions
Options controlling the behavior of code completion.
Definition: CodeCompleteOptions.h:15
clang::FrontendOptions::MTMigrateDir
std::string MTMigrateDir
Definition: FrontendOptions.h:418
clang::FrontendOptions::FixWhatYouCan
unsigned FixWhatYouCan
Apply fixes even if there are unfixable errors.
Definition: FrontendOptions.h:293
clang::Language::Unknown
@ Unknown
clang::FrontendOptions::RelocatablePCH
unsigned RelocatablePCH
When generating PCH files, instruct the AST writer to create relocatable PCH files.
Definition: FrontendOptions.h:275
clang::FrontendOptions::DisableFree
unsigned DisableFree
Disable memory freeing on exit.
Definition: FrontendOptions.h:271
clang::frontend::PrintPreprocessedInput
@ PrintPreprocessedInput
-E mode.
Definition: FrontendOptions.h:121
clang::InputKind::HeaderUnit_System
@ HeaderUnit_System
Definition: FrontendOptions.h:173
true
#define true
Definition: stdbool.h:21
clang::frontend::EmitLLVMOnly
@ EmitLLVMOnly
Generate LLVM IR, but do not emit anything.
Definition: FrontendOptions.h:70
clang::frontend::MigrateSource
@ MigrateSource
Run migrator.
Definition: FrontendOptions.h:139
clang::InputKind::withFormat
InputKind withFormat(Format F) const
Definition: FrontendOptions.h:214
clang::frontend::GenerateInterfaceStubs
@ GenerateInterfaceStubs
Generate Interface Stub Files.
Definition: FrontendOptions.h:100
clang::FrontendOptions::ObjCMT_Literals
@ ObjCMT_Literals
Enable migration to modern ObjC literals.
Definition: FrontendOptions.h:366
clang::InputKind::isPreprocessed
bool isPreprocessed() const
Definition: FrontendOptions.h:187
clang::FrontendOptions::ObjCMT_DesignatedInitializer
@ ObjCMT_DesignatedInitializer
Enable inferring NS_DESIGNATED_INITIALIZER for ObjC methods.
Definition: FrontendOptions.h:402
clang::frontend::InitOnly
@ InitOnly
Only execute frontend initialization.
Definition: FrontendOptions.h:103
clang::FrontendInputFile::FrontendInputFile
FrontendInputFile()=default
CommandLineSourceLoc.h
clang::FrontendOptions::CodeCompletionAt
ParsedSourceLocation CodeCompletionAt
If given, enable code completion at the provided location.
Definition: FrontendOptions.h:442
clang::frontend::PrintPreamble
@ PrintPreamble
Print the "preamble" of the input file.
Definition: FrontendOptions.h:118
clang::frontend::TemplightDump
@ TemplightDump
Dump template instantiations.
Definition: FrontendOptions.h:136
clang::frontend::GenerateModuleInterface
@ GenerateModuleInterface
Generate pre-compiled module from a C++ module interface file.
Definition: FrontendOptions.h:88
clang::frontend::EmitCodeGenOnly
@ EmitCodeGenOnly
Generate machine code, but don't emit anything.
Definition: FrontendOptions.h:73
clang::FrontendOptions::ObjCMT_NsMacros
@ ObjCMT_NsMacros
Enable migration to NS_ENUM/NS_OPTIONS macros.
Definition: FrontendOptions.h:387
clang::FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty
@ ObjCMT_NsAtomicIOSOnlyProperty
use NS_NONATOMIC_IOSONLY for property 'atomic' attribute
Definition: FrontendOptions.h:399