Coverage Report

Created: 2021-08-24 07:12

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Basic/LangOptions.h
Line
Count
Source (jump to first uncovered line)
1
//===- LangOptions.h - C Language Family Language Options -------*- 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
/// \file
10
/// Defines the clang::LangOptions interface.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_BASIC_LANGOPTIONS_H
15
#define LLVM_CLANG_BASIC_LANGOPTIONS_H
16
17
#include "clang/Basic/CommentOptions.h"
18
#include "clang/Basic/LLVM.h"
19
#include "clang/Basic/LangStandard.h"
20
#include "clang/Basic/ObjCRuntime.h"
21
#include "clang/Basic/Sanitizers.h"
22
#include "clang/Basic/TargetCXXABI.h"
23
#include "clang/Basic/Visibility.h"
24
#include "llvm/ADT/FloatingPointMode.h"
25
#include "llvm/ADT/StringRef.h"
26
#include "llvm/ADT/Triple.h"
27
#include <string>
28
#include <vector>
29
30
namespace clang {
31
32
/// Bitfields of LangOptions, split out from LangOptions in order to ensure that
33
/// this large collection of bitfields is a trivial class type.
34
class LangOptionsBase {
35
  friend class CompilerInvocation;
36
37
public:
38
  // Define simple language options (with no accessors).
39
#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits;
40
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description)
41
#include "clang/Basic/LangOptions.def"
42
43
protected:
44
  // Define language options of enumeration type. These are private, and will
45
  // have accessors (below).
46
#define LANGOPT(Name, Bits, Default, Description)
47
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
48
  unsigned Name : Bits;
49
#include "clang/Basic/LangOptions.def"
50
};
51
52
/// In the Microsoft ABI, this controls the placement of virtual displacement
53
/// members used to implement virtual inheritance.
54
enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable };
55
56
/// Keeps track of the various options that can be
57
/// enabled, which controls the dialect of C or C++ that is accepted.
58
class LangOptions : public LangOptionsBase {
59
public:
60
  using Visibility = clang::Visibility;
61
  using RoundingMode = llvm::RoundingMode;
62
63
  enum GCMode { NonGC, GCOnly, HybridGC };
64
  enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq };
65
66
  // Automatic variables live on the stack, and when trivial they're usually
67
  // uninitialized because it's undefined behavior to use them without
68
  // initializing them.
69
  enum class TrivialAutoVarInitKind { Uninitialized, Zero, Pattern };
70
71
  enum SignedOverflowBehaviorTy {
72
    // Default C standard behavior.
73
    SOB_Undefined,
74
75
    // -fwrapv
76
    SOB_Defined,
77
78
    // -ftrapv
79
    SOB_Trapping
80
  };
81
82
  // FIXME: Unify with TUKind.
83
  enum CompilingModuleKind {
84
    /// Not compiling a module interface at all.
85
    CMK_None,
86
87
    /// Compiling a module from a module map.
88
    CMK_ModuleMap,
89
90
    /// Compiling a module from a list of header files.
91
    CMK_HeaderModule,
92
93
    /// Compiling a C++ modules TS module interface unit.
94
    CMK_ModuleInterface,
95
  };
96
97
  enum PragmaMSPointersToMembersKind {
98
    PPTMK_BestCase,
99
    PPTMK_FullGeneralitySingleInheritance,
100
    PPTMK_FullGeneralityMultipleInheritance,
101
    PPTMK_FullGeneralityVirtualInheritance
102
  };
103
104
  using MSVtorDispMode = clang::MSVtorDispMode;
105
106
  enum DefaultCallingConvention {
107
    DCC_None,
108
    DCC_CDecl,
109
    DCC_FastCall,
110
    DCC_StdCall,
111
    DCC_VectorCall,
112
    DCC_RegCall
113
  };
114
115
  enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off };
116
117
  // Corresponds to _MSC_VER
118
  enum MSVCMajorVersion {
119
    MSVC2010 = 1600,
120
    MSVC2012 = 1700,
121
    MSVC2013 = 1800,
122
    MSVC2015 = 1900,
123
    MSVC2017 = 1910,
124
    MSVC2017_5 = 1912,
125
    MSVC2017_7 = 1914,
126
    MSVC2019 = 1920,
127
    MSVC2019_8 = 1928,
128
  };
129
130
  enum SYCLMajorVersion {
131
    SYCL_None,
132
    SYCL_2017,
133
    SYCL_2020,
134
    // The "default" SYCL version to be used when none is specified on the
135
    // frontend command line.
136
    SYCL_Default = SYCL_2020
137
  };
138
139
  /// Clang versions with different platform ABI conformance.
140
  enum class ClangABI {
141
    /// Attempt to be ABI-compatible with code generated by Clang 3.8.x
142
    /// (SVN r257626). This causes <1 x long long> to be passed in an
143
    /// integer register instead of an SSE register on x64_64.
144
    Ver3_8,
145
146
    /// Attempt to be ABI-compatible with code generated by Clang 4.0.x
147
    /// (SVN r291814). This causes move operations to be ignored when
148
    /// determining whether a class type can be passed or returned directly.
149
    Ver4,
150
151
    /// Attempt to be ABI-compatible with code generated by Clang 6.0.x
152
    /// (SVN r321711). This causes determination of whether a type is
153
    /// standard-layout to ignore collisions between empty base classes
154
    /// and between base classes and member subobjects, which affects
155
    /// whether we reuse base class tail padding in some ABIs.
156
    Ver6,
157
158
    /// Attempt to be ABI-compatible with code generated by Clang 7.0.x
159
    /// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be
160
    /// compatible with __alignof (i.e., return the preferred alignment)
161
    /// rather than returning the required alignment.
162
    Ver7,
163
164
    /// Attempt to be ABI-compatible with code generated by Clang 9.0.x
165
    /// (SVN r351319). This causes vectors of __int128 to be passed in memory
166
    /// instead of passing in multiple scalar registers on x86_64 on Linux and
167
    /// NetBSD.
168
    Ver9,
169
170
    /// Attempt to be ABI-compatible with code generated by Clang 11.0.x
171
    /// (git 2e10b7a39b93). This causes clang to pass unions with a 256-bit
172
    /// vector member on the stack instead of using registers, to not properly
173
    /// mangle substitutions for template names in some cases, and to mangle
174
    /// declaration template arguments without a cast to the parameter type
175
    /// even when that can lead to mangling collisions.
176
    Ver11,
177
178
    /// Attempt to be ABI-compatible with code generated by Clang 12.0.x
179
    /// (git 8e464dd76bef). This causes clang to mangle lambdas within
180
    /// global-scope inline variables incorrectly.
181
    Ver12,
182
183
    /// Conform to the underlying platform's C and C++ ABIs as closely
184
    /// as we can.
185
    Latest
186
  };
187
188
  enum class CoreFoundationABI {
189
    /// No interoperability ABI has been specified
190
    Unspecified,
191
    /// CoreFoundation does not have any language interoperability
192
    Standalone,
193
    /// Interoperability with the ObjectiveC runtime
194
    ObjectiveC,
195
    /// Interoperability with the latest known version of the Swift runtime
196
    Swift,
197
    /// Interoperability with the Swift 5.0 runtime
198
    Swift5_0,
199
    /// Interoperability with the Swift 4.2 runtime
200
    Swift4_2,
201
    /// Interoperability with the Swift 4.1 runtime
202
    Swift4_1,
203
  };
204
205
  enum FPModeKind {
206
    // Disable the floating point pragma
207
    FPM_Off,
208
209
    // Enable the floating point pragma
210
    FPM_On,
211
212
    // Aggressively fuse FP ops (E.g. FMA) disregarding pragmas.
213
    FPM_Fast,
214
215
    // Aggressively fuse FP ops and honor pragmas.
216
    FPM_FastHonorPragmas
217
  };
218
219
  /// Alias for RoundingMode::NearestTiesToEven.
220
  static constexpr unsigned FPR_ToNearest =
221
      static_cast<unsigned>(llvm::RoundingMode::NearestTiesToEven);
222
223
  /// Possible floating point exception behavior.
224
  enum FPExceptionModeKind {
225
    /// Assume that floating-point exceptions are masked.
226
    FPE_Ignore,
227
    /// Transformations do not cause new exceptions but may hide some.
228
    FPE_MayTrap,
229
    /// Strictly preserve the floating-point exception semantics.
230
    FPE_Strict
231
  };
232
233
  /// Possible exception handling behavior.
234
  enum class ExceptionHandlingKind { None, SjLj, WinEH, DwarfCFI, Wasm };
235
236
  /// Possible float expression evaluation method choices.
237
  enum FPEvalMethodKind {
238
    /// Use the declared type for fp arithmetic.
239
    FEM_Source,
240
    /// Use the type double for fp arithmetic.
241
    FEM_Double,
242
    /// Use extended type for fp arithmetic.
243
    FEM_Extended,
244
    /// Use the default float eval method specified by Target:
245
    //  most targets are defined with evaluation method FEM_Source.
246
    FEM_TargetDefault
247
  };
248
249
  enum class LaxVectorConversionKind {
250
    /// Permit no implicit vector bitcasts.
251
    None,
252
    /// Permit vector bitcasts between integer vectors with different numbers
253
    /// of elements but the same total bit-width.
254
    Integer,
255
    /// Permit vector bitcasts between all vectors with the same total
256
    /// bit-width.
257
    All,
258
  };
259
260
  enum class AltivecSrcCompatKind {
261
    // All vector compares produce scalars except vector pixel and vector bool.
262
    // The types vector pixel and vector bool return vector results.
263
    Mixed,
264
    // All vector compares produce vector results as in GCC.
265
    GCC,
266
    // All vector compares produce scalars as in XL.
267
    XL,
268
    // Default clang behaviour.
269
    Default = Mixed,
270
  };
271
272
  enum class SignReturnAddressScopeKind {
273
    /// No signing for any function.
274
    None,
275
    /// Sign the return address of functions that spill LR.
276
    NonLeaf,
277
    /// Sign the return address of all functions,
278
    All
279
  };
280
281
  enum class SignReturnAddressKeyKind {
282
    /// Return address signing uses APIA key.
283
    AKey,
284
    /// Return address signing uses APIB key.
285
    BKey
286
  };
287
288
  enum class ThreadModelKind {
289
    /// POSIX Threads.
290
    POSIX,
291
    /// Single Threaded Environment.
292
    Single
293
  };
294
295
  enum class ExtendArgsKind {
296
    /// Integer arguments are sign or zero extended to 32/64 bits
297
    /// during default argument promotions.
298
    ExtendTo32,
299
    ExtendTo64
300
  };
301
302
public:
303
  /// The used language standard.
304
  LangStandard::Kind LangStd;
305
306
  /// Set of enabled sanitizers.
307
  SanitizerSet Sanitize;
308
  /// Is at least one coverage instrumentation type enabled.
309
  bool SanitizeCoverage = false;
310
311
  /// Paths to files specifying which objects
312
  /// (files, functions, variables) should not be instrumented.
313
  std::vector<std::string> NoSanitizeFiles;
314
315
  /// Paths to the XRay "always instrument" files specifying which
316
  /// objects (files, functions, variables) should be imbued with the XRay
317
  /// "always instrument" attribute.
318
  /// WARNING: This is a deprecated field and will go away in the future.
319
  std::vector<std::string> XRayAlwaysInstrumentFiles;
320
321
  /// Paths to the XRay "never instrument" files specifying which
322
  /// objects (files, functions, variables) should be imbued with the XRay
323
  /// "never instrument" attribute.
324
  /// WARNING: This is a deprecated field and will go away in the future.
325
  std::vector<std::string> XRayNeverInstrumentFiles;
326
327
  /// Paths to the XRay attribute list files, specifying which objects
328
  /// (files, functions, variables) should be imbued with the appropriate XRay
329
  /// attribute(s).
330
  std::vector<std::string> XRayAttrListFiles;
331
332
  /// Paths to special case list files specifying which entities
333
  /// (files, functions) should or should not be instrumented.
334
  std::vector<std::string> ProfileListFiles;
335
336
  clang::ObjCRuntime ObjCRuntime;
337
338
  CoreFoundationABI CFRuntime = CoreFoundationABI::Unspecified;
339
340
  std::string ObjCConstantStringClass;
341
342
  /// The name of the handler function to be called when -ftrapv is
343
  /// specified.
344
  ///
345
  /// If none is specified, abort (GCC-compatible behaviour).
346
  std::string OverflowHandler;
347
348
  /// The module currently being compiled as specified by -fmodule-name.
349
  std::string ModuleName;
350
351
  /// The name of the current module, of which the main source file
352
  /// is a part. If CompilingModule is set, we are compiling the interface
353
  /// of this module, otherwise we are compiling an implementation file of
354
  /// it. This starts as ModuleName in case -fmodule-name is provided and
355
  /// changes during compilation to reflect the current module.
356
  std::string CurrentModule;
357
358
  /// The names of any features to enable in module 'requires' decls
359
  /// in addition to the hard-coded list in Module.cpp and the target features.
360
  ///
361
  /// This list is sorted.
362
  std::vector<std::string> ModuleFeatures;
363
364
  /// Options for parsing comments.
365
  CommentOptions CommentOpts;
366
367
  /// A list of all -fno-builtin-* function names (e.g., memset).
368
  std::vector<std::string> NoBuiltinFuncs;
369
370
  /// A prefix map for __FILE__, __BASE_FILE__ and __builtin_FILE().
371
  std::map<std::string, std::string, std::greater<std::string>> MacroPrefixMap;
372
373
  /// Triples of the OpenMP targets that the host code codegen should
374
  /// take into account in order to generate accurate offloading descriptors.
375
  std::vector<llvm::Triple> OMPTargetTriples;
376
377
  /// Name of the IR file that contains the result of the OpenMP target
378
  /// host code generation.
379
  std::string OMPHostIRFile;
380
381
  /// The user provided compilation unit ID, if non-empty. This is used to
382
  /// externalize static variables which is needed to support accessing static
383
  /// device variables in host code for single source offloading languages
384
  /// like CUDA/HIP.
385
  std::string CUID;
386
387
  /// C++ ABI to compile with, if specified by the frontend through -fc++-abi=.
388
  /// This overrides the default ABI used by the target.
389
  llvm::Optional<TargetCXXABI::Kind> CXXABI;
390
391
  /// Indicates whether the front-end is explicitly told that the
392
  /// input is a header file (i.e. -x c-header).
393
  bool IsHeaderFile = false;
394
395
  LangOptions();
396
397
  // Define accessors/mutators for language options of enumeration type.
398
#define LANGOPT(Name, Bits, Default, Description)
399
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
400
270M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getLaxVectorConversions() const
Line
Count
Source
400
1.75M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getAltivecSrcCompat() const
Line
Count
Source
400
6.74M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getExceptionHandling() const
Line
Count
Source
400
875k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getCompilingModule() const
Line
Count
Source
400
193M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getMSPointerToMemberRepresentationMethod() const
Line
Count
Source
400
128k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getDefaultCallingConv() const
Line
Count
Source
400
31.6M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getSYCLVersion() const
Line
Count
Source
400
34.2k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getDefaultFPContractMode() const
Line
Count
Source
400
2.03M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getFPRoundingMode() const
Line
Count
Source
400
2.39M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getFPExceptionMode() const
Line
Count
Source
400
2.80M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getFPEvalMethod() const
Line
Count
Source
400
2.10M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getAddressSpaceMapMangling() const
Line
Count
Source
400
136k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getGC() const
Line
Count
Source
400
10.9M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getValueVisibilityMode() const
Line
Count
Source
400
1.06M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getTypeVisibilityMode() const
Line
Count
Source
400
211k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getDLLExportVisibility() const
Line
Count
Source
400
34.1k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getNoDLLStorageClassVisibility() const
Line
Count
Source
400
34.1k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getExternDeclDLLImportVisibility() const
Line
Count
Source
400
34.1k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getExternDeclNoDLLStorageClassVisibility() const
Line
Count
Source
400
34.1k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getStackProtector() const
Line
Count
Source
400
1.23M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getTrivialAutoVarInit() const
Line
Count
Source
400
274k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getSignedOverflowBehavior() const
Line
Count
Source
400
398k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getThreadModel() const
Line
Count
Source
400
130k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getVtorDispMode() const
Line
Count
Source
400
1.19M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getClangABICompat() const
Line
Count
Source
400
10.4M
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getSignReturnAddressScope() const
Line
Count
Source
400
315k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getSignReturnAddressKey() const
Line
Count
Source
400
172k
  Type get##Name() const { return static_cast<Type>(Name); } \
clang::LangOptions::getExtendIntArgs() const
Line
Count
Source
400
125k
  Type get##Name() const { return static_cast<Type>(Name); } \
401
220M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setLaxVectorConversions(clang::LangOptions::LaxVectorConversionKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setAltivecSrcCompat(clang::LangOptions::AltivecSrcCompatKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setExceptionHandling(clang::LangOptions::ExceptionHandlingKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setCompilingModule(clang::LangOptions::CompilingModuleKind)
Line
Count
Source
401
7.93M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setMSPointerToMemberRepresentationMethod(clang::LangOptions::PragmaMSPointersToMembersKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setDefaultCallingConv(clang::LangOptions::DefaultCallingConvention)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setSYCLVersion(clang::LangOptions::SYCLMajorVersion)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setDefaultFPContractMode(clang::LangOptions::FPModeKind)
Line
Count
Source
401
7.93M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setFPRoundingMode(llvm::RoundingMode)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setFPExceptionMode(clang::LangOptions::FPExceptionModeKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setFPEvalMethod(clang::LangOptions::FPEvalMethodKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setAddressSpaceMapMangling(clang::LangOptions::AddrSpaceMapMangling)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setGC(clang::LangOptions::GCMode)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setValueVisibilityMode(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setTypeVisibilityMode(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setDLLExportVisibility(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setNoDLLStorageClassVisibility(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setExternDeclDLLImportVisibility(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setExternDeclNoDLLStorageClassVisibility(clang::Visibility)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setStackProtector(clang::LangOptions::StackProtectorMode)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setTrivialAutoVarInit(clang::LangOptions::TrivialAutoVarInitKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setSignedOverflowBehavior(clang::LangOptions::SignedOverflowBehaviorTy)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setThreadModel(clang::LangOptions::ThreadModelKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setVtorDispMode(clang::MSVtorDispMode)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setClangABICompat(clang::LangOptions::ClangABI)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setSignReturnAddressScope(clang::LangOptions::SignReturnAddressScopeKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setSignReturnAddressKey(clang::LangOptions::SignReturnAddressKeyKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
clang::LangOptions::setExtendIntArgs(clang::LangOptions::ExtendArgsKind)
Line
Count
Source
401
7.86M
  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
402
#include "clang/Basic/LangOptions.def"
403
404
  /// Are we compiling a module interface (.cppm or module map)?
405
193M
  bool isCompilingModule() const {
406
193M
    return getCompilingModule() != CMK_None;
407
193M
  }
408
409
  /// Do we need to track the owning module for a local declaration?
410
173M
  bool trackLocalOwningModule() const {
411
173M
    return isCompilingModule() || 
ModulesLocalVisibility163M
;
412
173M
  }
413
414
102k
  bool isSignedOverflowDefined() const {
415
102k
    return getSignedOverflowBehavior() == SOB_Defined;
416
102k
  }
417
418
591
  bool isSubscriptPointerArithmetic() const {
419
591
    return ObjCRuntime.isSubscriptPointerArithmetic() &&
420
591
           
!ObjCSubscriptingLegacyRuntime17
;
421
591
  }
422
423
98.6k
  bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const {
424
98.6k
    return MSCompatibilityVersion >= MajorVersion * 100000U;
425
98.6k
  }
426
427
  /// Reset all of the options that are not considered when building a
428
  /// module.
429
  void resetNonModularOptions();
430
431
  /// Is this a libc/libm function that is no longer recognized as a
432
  /// builtin because a -fno-builtin-* option has been specified?
433
  bool isNoBuiltinFunc(StringRef Name) const;
434
435
  /// True if any ObjC types may have non-trivial lifetime qualifiers.
436
7.49M
  bool allowsNonTrivialObjCLifetimeQualifiers() const {
437
7.49M
    return ObjCAutoRefCount || 
ObjCWeak7.46M
;
438
7.49M
  }
439
440
798k
  bool assumeFunctionsAreConvergent() const {
441
798k
    return ConvergentFunctions;
442
798k
  }
443
444
  /// Return the OpenCL C or C++ version as a VersionTuple.
445
  VersionTuple getOpenCLVersionTuple() const;
446
447
  /// Return the OpenCL C or C++ for OpenCL language name and version
448
  /// as a string.
449
  std::string getOpenCLVersionString() const;
450
451
  /// Check if return address signing is enabled.
452
5.75k
  bool hasSignReturnAddress() const {
453
5.75k
    return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;
454
5.75k
  }
455
456
  /// Check if return address signing uses AKey.
457
2.45k
  bool isSignReturnAddressWithAKey() const {
458
2.45k
    return getSignReturnAddressKey() == SignReturnAddressKeyKind::AKey;
459
2.45k
  }
460
461
  /// Check if leaf functions are also signed.
462
2.45k
  bool isSignReturnAddressScopeAll() const {
463
2.45k
    return getSignReturnAddressScope() == SignReturnAddressScopeKind::All;
464
2.45k
  }
465
466
201k
  bool hasSjLjExceptions() const {
467
201k
    return getExceptionHandling() == ExceptionHandlingKind::SjLj;
468
201k
  }
469
470
201k
  bool hasSEHExceptions() const {
471
201k
    return getExceptionHandling() == ExceptionHandlingKind::WinEH;
472
201k
  }
473
474
201k
  bool hasDWARFExceptions() const {
475
201k
    return getExceptionHandling() == ExceptionHandlingKind::DwarfCFI;
476
201k
  }
477
478
100k
  bool hasWasmExceptions() const {
479
100k
    return getExceptionHandling() == ExceptionHandlingKind::Wasm;
480
100k
  }
481
482
15.3M
  bool isSYCL() const { return SYCLIsDevice || 
SYCLIsHost15.3M
; }
483
484
  /// Remap path prefix according to -fmacro-prefix-path option.
485
  void remapPathPrefix(SmallString<256> &Path) const;
486
};
487
488
/// Floating point control options
489
class FPOptionsOverride;
490
class FPOptions {
491
public:
492
  // We start by defining the layout.
493
  using storage_type = uint16_t;
494
495
  using RoundingMode = llvm::RoundingMode;
496
497
  static constexpr unsigned StorageBitSize = 8 * sizeof(storage_type);
498
499
  // Define a fake option named "First" so that we have a PREVIOUS even for the
500
  // real first option.
501
  static constexpr storage_type FirstShift = 0, FirstWidth = 0;
502
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
503
  static constexpr storage_type NAME##Shift =                                  \
504
      PREVIOUS##Shift + PREVIOUS##Width;                                       \
505
  static constexpr storage_type NAME##Width = WIDTH;                           \
506
  static constexpr storage_type NAME##Mask = ((1 << NAME##Width) - 1)          \
507
                                             << NAME##Shift;
508
#include "clang/Basic/FPOptions.def"
509
510
  static constexpr storage_type TotalWidth = 0
511
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) +WIDTH
512
#include "clang/Basic/FPOptions.def"
513
      ;
514
  static_assert(TotalWidth <= StorageBitSize, "Too short type for FPOptions");
515
516
private:
517
  storage_type Value;
518
519
public:
520
87.8M
  FPOptions() : Value(0) {
521
87.8M
    setFPContractMode(LangOptions::FPM_Off);
522
87.8M
    setRoundingMode(static_cast<RoundingMode>(LangOptions::FPR_ToNearest));
523
87.8M
    setFPExceptionMode(LangOptions::FPE_Ignore);
524
87.8M
  }
525
2.00M
  explicit FPOptions(const LangOptions &LO) {
526
2.00M
    Value = 0;
527
    // The language fp contract option FPM_FastHonorPragmas has the same effect
528
    // as FPM_Fast in frontend. For simplicity, use FPM_Fast uniformly in
529
    // frontend.
530
2.00M
    auto LangOptContractMode = LO.getDefaultFPContractMode();
531
2.00M
    if (LangOptContractMode == LangOptions::FPM_FastHonorPragmas)
532
1.01k
      LangOptContractMode = LangOptions::FPM_Fast;
533
2.00M
    setFPContractMode(LangOptContractMode);
534
2.00M
    setRoundingMode(LO.getFPRoundingMode());
535
2.00M
    setFPExceptionMode(LO.getFPExceptionMode());
536
2.00M
    setAllowFPReassociate(LO.AllowFPReassoc);
537
2.00M
    setNoHonorNaNs(LO.NoHonorNaNs);
538
2.00M
    setNoHonorInfs(LO.NoHonorInfs);
539
2.00M
    setNoSignedZero(LO.NoSignedZero);
540
2.00M
    setAllowReciprocal(LO.AllowRecip);
541
2.00M
    setAllowApproxFunc(LO.ApproxFunc);
542
2.00M
    if (getFPContractMode() == LangOptions::FPM_On &&
543
2.00M
        
getRoundingMode() == llvm::RoundingMode::Dynamic4.99k
&&
544
2.00M
        
getFPExceptionMode() == LangOptions::FPE_Strict0
)
545
      // If the FP settings are set to the "strict" model, then
546
      // FENV access is set to true. (ffp-model=strict)
547
0
      setAllowFEnvAccess(true);
548
2.00M
    else
549
2.00M
      setAllowFEnvAccess(LangOptions::FPM_Off);
550
2.00M
    setFPEvalMethod(LO.getFPEvalMethod());
551
2.00M
  }
552
553
6.24k
  bool allowFPContractWithinStatement() const {
554
6.24k
    return getFPContractMode() == LangOptions::FPM_On;
555
6.24k
  }
556
0
  void setAllowFPContractWithinStatement() {
557
0
    setFPContractMode(LangOptions::FPM_On);
558
0
  }
559
560
379k
  bool allowFPContractAcrossStatement() const {
561
379k
    return getFPContractMode() == LangOptions::FPM_Fast;
562
379k
  }
563
0
  void setAllowFPContractAcrossStatement() {
564
0
    setFPContractMode(LangOptions::FPM_Fast);
565
0
  }
566
567
37.5M
  bool isFPConstrained() const {
568
37.5M
    return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven ||
569
37.5M
           
getFPExceptionMode() != LangOptions::FPE_Ignore37.5M
||
570
37.5M
           
getAllowFEnvAccess()37.3M
;
571
37.5M
  }
572
573
41.8M
  bool operator==(FPOptions other) const { return Value == other.Value; }
574
575
  /// Return the default value of FPOptions that's used when trailing
576
  /// storage isn't required.
577
  static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO);
578
579
1.61M
  storage_type getAsOpaqueInt() const { return Value; }
580
87.1M
  static FPOptions getFromOpaqueInt(storage_type Value) {
581
87.1M
    FPOptions Opts;
582
87.1M
    Opts.Value = Value;
583
87.1M
    return Opts;
584
87.1M
  }
585
586
  // We can define most of the accessors automatically:
587
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
588
126M
  TYPE get##NAME() const {                                                     \
589
126M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
126M
  }                                                                            \
clang::FPOptions::getFPContractMode() const
Line
Count
Source
588
2.39M
  TYPE get##NAME() const {                                                     \
589
2.39M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
2.39M
  }                                                                            \
clang::FPOptions::getRoundingMode() const
Line
Count
Source
588
37.6M
  TYPE get##NAME() const {                                                     \
589
37.6M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
37.6M
  }                                                                            \
clang::FPOptions::getFPExceptionMode() const
Line
Count
Source
588
37.6M
  TYPE get##NAME() const {                                                     \
589
37.6M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
37.6M
  }                                                                            \
clang::FPOptions::getAllowFEnvAccess() const
Line
Count
Source
588
37.3M
  TYPE get##NAME() const {                                                     \
589
37.3M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
37.3M
  }                                                                            \
clang::FPOptions::getAllowFPReassociate() const
Line
Count
Source
588
381k
  TYPE get##NAME() const {                                                     \
589
381k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
381k
  }                                                                            \
clang::FPOptions::getNoHonorNaNs() const
Line
Count
Source
588
381k
  TYPE get##NAME() const {                                                     \
589
381k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
381k
  }                                                                            \
clang::FPOptions::getNoHonorInfs() const
Line
Count
Source
588
381k
  TYPE get##NAME() const {                                                     \
589
381k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
381k
  }                                                                            \
clang::FPOptions::getNoSignedZero() const
Line
Count
Source
588
381k
  TYPE get##NAME() const {                                                     \
589
381k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
381k
  }                                                                            \
clang::FPOptions::getAllowReciprocal() const
Line
Count
Source
588
379k
  TYPE get##NAME() const {                                                     \
589
379k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
379k
  }                                                                            \
clang::FPOptions::getAllowApproxFunc() const
Line
Count
Source
588
379k
  TYPE get##NAME() const {                                                     \
589
379k
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
379k
  }                                                                            \
clang::FPOptions::getFPEvalMethod() const
Line
Count
Source
588
9.48M
  TYPE get##NAME() const {                                                     \
589
9.48M
    return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift);             \
590
9.48M
  }                                                                            \
591
285M
  void set##NAME(TYPE value) {                                                 \
592
285M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
285M
  }
clang::FPOptions::setFPContractMode(clang::LangOptions::FPModeKind)
Line
Count
Source
591
89.8M
  void set##NAME(TYPE value) {                                                 \
592
89.8M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
89.8M
  }
clang::FPOptions::setRoundingMode(llvm::RoundingMode)
Line
Count
Source
591
89.8M
  void set##NAME(TYPE value) {                                                 \
592
89.8M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
89.8M
  }
clang::FPOptions::setFPExceptionMode(clang::LangOptions::FPExceptionModeKind)
Line
Count
Source
591
89.8M
  void set##NAME(TYPE value) {                                                 \
592
89.8M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
89.8M
  }
clang::FPOptions::setAllowFEnvAccess(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setAllowFPReassociate(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setNoHonorNaNs(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setNoHonorInfs(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setNoSignedZero(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setAllowReciprocal(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setAllowApproxFunc(bool)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
clang::FPOptions::setFPEvalMethod(clang::LangOptions::FPEvalMethodKind)
Line
Count
Source
591
2.00M
  void set##NAME(TYPE value) {                                                 \
592
2.00M
    Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift);      \
593
2.00M
  }
594
#include "clang/Basic/FPOptions.def"
595
  LLVM_DUMP_METHOD void dump();
596
};
597
598
/// Represents difference between two FPOptions values.
599
///
600
/// The effect of language constructs changing the set of floating point options
601
/// is usually a change of some FP properties while leaving others intact. This
602
/// class describes such changes by keeping information about what FP options
603
/// are overridden.
604
///
605
/// The integral set of FP options, described by the class FPOptions, may be
606
/// represented as a default FP option set, defined by language standard and
607
/// command line options, with the overrides introduced by pragmas.
608
///
609
/// The is implemented as a value of the new FPOptions plus a mask showing which
610
/// fields are actually set in it.
611
class FPOptionsOverride {
612
  FPOptions Options = FPOptions::getFromOpaqueInt(0);
613
  FPOptions::storage_type OverrideMask = 0;
614
615
public:
616
  using RoundingMode = llvm::RoundingMode;
617
618
  /// The type suitable for storing values of FPOptionsOverride. Must be twice
619
  /// as wide as bit size of FPOption.
620
  using storage_type = uint32_t;
621
  static_assert(sizeof(storage_type) >= 2 * sizeof(FPOptions::storage_type),
622
                "Too short type for FPOptionsOverride");
623
624
  /// Bit mask selecting bits of OverrideMask in serialized representation of
625
  /// FPOptionsOverride.
626
  static constexpr storage_type OverrideMaskBits =
627
      (static_cast<storage_type>(1) << FPOptions::StorageBitSize) - 1;
628
629
86.2M
  FPOptionsOverride() {}
630
  FPOptionsOverride(const LangOptions &LO)
631
0
      : Options(LO), OverrideMask(OverrideMaskBits) {}
632
  FPOptionsOverride(FPOptions FPO)
633
0
      : Options(FPO), OverrideMask(OverrideMaskBits) {}
634
635
87.3M
  bool requiresTrailingStorage() const { return OverrideMask != 0; }
636
637
115
  void setAllowFPContractWithinStatement() {
638
115
    setFPContractModeOverride(LangOptions::FPM_On);
639
115
  }
640
641
99
  void setAllowFPContractAcrossStatement() {
642
99
    setFPContractModeOverride(LangOptions::FPM_Fast);
643
99
  }
644
645
10
  void setDisallowFPContract() {
646
10
    setFPContractModeOverride(LangOptions::FPM_Off);
647
10
  }
648
649
148
  void setFPPreciseEnabled(bool Value) {
650
148
    setAllowFPReassociateOverride(!Value);
651
148
    setNoHonorNaNsOverride(!Value);
652
148
    setNoHonorInfsOverride(!Value);
653
148
    setNoSignedZeroOverride(!Value);
654
148
    setAllowReciprocalOverride(!Value);
655
148
    setAllowApproxFuncOverride(!Value);
656
148
    if (Value)
657
      /* Precise mode implies fp_contract=on and disables ffast-math */
658
59
      setAllowFPContractWithinStatement();
659
89
    else
660
      /* Precise mode disabled sets fp_contract=fast and enables ffast-math */
661
89
      setAllowFPContractAcrossStatement();
662
148
  }
663
664
8.70k
  storage_type getAsOpaqueInt() const {
665
8.70k
    return (static_cast<storage_type>(Options.getAsOpaqueInt())
666
8.70k
            << FPOptions::StorageBitSize) |
667
8.70k
           OverrideMask;
668
8.70k
  }
669
8.08k
  static FPOptionsOverride getFromOpaqueInt(storage_type I) {
670
8.08k
    FPOptionsOverride Opts;
671
8.08k
    Opts.OverrideMask = I & OverrideMaskBits;
672
8.08k
    Opts.Options = FPOptions::getFromOpaqueInt(I >> FPOptions::StorageBitSize);
673
8.08k
    return Opts;
674
8.08k
  }
675
676
804k
  FPOptions applyOverrides(FPOptions Base) {
677
804k
    FPOptions Result =
678
804k
        FPOptions::getFromOpaqueInt((Base.getAsOpaqueInt() & ~OverrideMask) |
679
804k
                                     (Options.getAsOpaqueInt() & OverrideMask));
680
804k
    return Result;
681
804k
  }
682
683
804k
  FPOptions applyOverrides(const LangOptions &LO) {
684
804k
    return applyOverrides(FPOptions(LO));
685
804k
  }
686
687
41.6M
  bool operator==(FPOptionsOverride other) const {
688
41.6M
    return Options == other.Options && 
OverrideMask == other.OverrideMask41.1M
;
689
41.6M
  }
690
41.6M
  bool operator!=(FPOptionsOverride other) const { return !(*this == other); }
691
692
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS)                                    \
693
1.05k
  bool has##NAME##Override() const {                                           \
694
1.05k
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
1.05k
  }                                                                            \
clang::FPOptionsOverride::hasFPContractModeOverride() const
Line
Count
Source
693
124
  bool has##NAME##Override() const {                                           \
694
124
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
124
  }                                                                            \
clang::FPOptionsOverride::hasRoundingModeOverride() const
Line
Count
Source
693
140
  bool has##NAME##Override() const {                                           \
694
140
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
140
  }                                                                            \
clang::FPOptionsOverride::hasFPExceptionModeOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasAllowFEnvAccessOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasAllowFPReassociateOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasNoHonorNaNsOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasNoHonorInfsOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasNoSignedZeroOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasAllowReciprocalOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasAllowApproxFuncOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
clang::FPOptionsOverride::hasFPEvalMethodOverride() const
Line
Count
Source
693
88
  bool has##NAME##Override() const {                                           \
694
88
    return OverrideMask & FPOptions::NAME##Mask;                               \
695
88
  }                                                                            \
696
88
  TYPE get##NAME##Override() const {                                           \
697
88
    assert(has##NAME##Override());                                             \
698
88
    return Options.get##NAME();                                                \
699
88
  }                                                                            \
clang::FPOptionsOverride::getFPContractModeOverride() const
Line
Count
Source
696
36
  TYPE get##NAME##Override() const {                                           \
697
36
    assert(has##NAME##Override());                                             \
698
36
    return Options.get##NAME();                                                \
699
36
  }                                                                            \
clang::FPOptionsOverride::getRoundingModeOverride() const
Line
Count
Source
696
52
  TYPE get##NAME##Override() const {                                           \
697
52
    assert(has##NAME##Override());                                             \
698
52
    return Options.get##NAME();                                                \
699
52
  }                                                                            \
Unexecuted instantiation: clang::FPOptionsOverride::getFPExceptionModeOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getAllowFEnvAccessOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getAllowFPReassociateOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getNoHonorNaNsOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getNoHonorInfsOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getNoSignedZeroOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getAllowReciprocalOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getAllowApproxFuncOverride() const
Unexecuted instantiation: clang::FPOptionsOverride::getFPEvalMethodOverride() const
700
0
  void clear##NAME##Override() {                                               \
701
0
    /* Clear the actual value so that we don't have spurious differences when  \
702
0
     * testing equality. */                                                    \
703
0
    Options.set##NAME(TYPE(0));                                                \
704
0
    OverrideMask &= ~FPOptions::NAME##Mask;                                    \
705
0
  }                                                                            \
Unexecuted instantiation: clang::FPOptionsOverride::clearFPContractModeOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearRoundingModeOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearFPExceptionModeOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearAllowFEnvAccessOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearAllowFPReassociateOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearNoHonorNaNsOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearNoHonorInfsOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearNoSignedZeroOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearAllowReciprocalOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearAllowApproxFuncOverride()
Unexecuted instantiation: clang::FPOptionsOverride::clearFPEvalMethodOverride()
706
1.35k
  void set##NAME##Override(TYPE value) {                                       \
707
1.35k
    Options.set##NAME(value);                                                  \
708
1.35k
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
1.35k
  }
clang::FPOptionsOverride::setFPContractModeOverride(clang::LangOptions::FPModeKind)
Line
Count
Source
706
224
  void set##NAME##Override(TYPE value) {                                       \
707
224
    Options.set##NAME(value);                                                  \
708
224
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
224
  }
clang::FPOptionsOverride::setRoundingModeOverride(llvm::RoundingMode)
Line
Count
Source
706
44
  void set##NAME##Override(TYPE value) {                                       \
707
44
    Options.set##NAME(value);                                                  \
708
44
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
44
  }
clang::FPOptionsOverride::setFPExceptionModeOverride(clang::LangOptions::FPExceptionModeKind)
Line
Count
Source
706
132
  void set##NAME##Override(TYPE value) {                                       \
707
132
    Options.set##NAME(value);                                                  \
708
132
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
132
  }
clang::FPOptionsOverride::setAllowFEnvAccessOverride(bool)
Line
Count
Source
706
18
  void set##NAME##Override(TYPE value) {                                       \
707
18
    Options.set##NAME(value);                                                  \
708
18
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
18
  }
clang::FPOptionsOverride::setAllowFPReassociateOverride(bool)
Line
Count
Source
706
166
  void set##NAME##Override(TYPE value) {                                       \
707
166
    Options.set##NAME(value);                                                  \
708
166
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
166
  }
clang::FPOptionsOverride::setNoHonorNaNsOverride(bool)
Line
Count
Source
706
148
  void set##NAME##Override(TYPE value) {                                       \
707
148
    Options.set##NAME(value);                                                  \
708
148
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
148
  }
clang::FPOptionsOverride::setNoHonorInfsOverride(bool)
Line
Count
Source
706
148
  void set##NAME##Override(TYPE value) {                                       \
707
148
    Options.set##NAME(value);                                                  \
708
148
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
148
  }
clang::FPOptionsOverride::setNoSignedZeroOverride(bool)
Line
Count
Source
706
148
  void set##NAME##Override(TYPE value) {                                       \
707
148
    Options.set##NAME(value);                                                  \
708
148
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
148
  }
clang::FPOptionsOverride::setAllowReciprocalOverride(bool)
Line
Count
Source
706
148
  void set##NAME##Override(TYPE value) {                                       \
707
148
    Options.set##NAME(value);                                                  \
708
148
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
148
  }
clang::FPOptionsOverride::setAllowApproxFuncOverride(bool)
Line
Count
Source
706
148
  void set##NAME##Override(TYPE value) {                                       \
707
148
    Options.set##NAME(value);                                                  \
708
148
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
148
  }
clang::FPOptionsOverride::setFPEvalMethodOverride(clang::LangOptions::FPEvalMethodKind)
Line
Count
Source
706
33
  void set##NAME##Override(TYPE value) {                                       \
707
33
    Options.set##NAME(value);                                                  \
708
33
    OverrideMask |= FPOptions::NAME##Mask;                                     \
709
33
  }
710
#include "clang/Basic/FPOptions.def"
711
  LLVM_DUMP_METHOD void dump();
712
};
713
714
/// Describes the kind of translation unit being processed.
715
enum TranslationUnitKind {
716
  /// The translation unit is a complete translation unit.
717
  TU_Complete,
718
719
  /// The translation unit is a prefix to a translation unit, and is
720
  /// not complete.
721
  TU_Prefix,
722
723
  /// The translation unit is a module.
724
  TU_Module,
725
726
  /// The translation unit is a is a complete translation unit that we might
727
  /// incrementally extend later.
728
  TU_Incremental
729
};
730
731
} // namespace clang
732
733
#endif // LLVM_CLANG_BASIC_LANGOPTIONS_H