Coverage Report

Created: 2022-01-18 06:27

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