Coverage Report

Created: 2021-01-23 06:44

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