;
20#define LANGOPT(Name, Bits, Default, Description) Name = Default; 21#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default); 22#include "clang/Basic/LangOptions.def" 26#define LANGOPT(Name, Bits, Default, Description) 27#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default; 28#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ 29 Name = static_cast<unsigned>(Default); 30#include "clang/Basic/LangOptions.def" 36AllowFPReassoc = UnsafeFPMath;
37NoHonorInfs = FastMath;
38NoHonorNaNs = FastMath;
57 const intVer = OpenCLCPlusPlus ? OpenCLCPlusPlusVersion : OpenCLVersion;
58 if(OpenCLCPlusPlus && Ver != 100)
59 returnVersionTuple(Ver / 100);
60 returnVersionTuple(Ver / 100, (Ver % 100) / 10);
66 if(OpenCLCPlusPlusVersion == 100)
68 if(OpenCLCPlusPlusVersion == 202100)
70llvm_unreachable(
"Unknown OpenCL version");
75 if(llvm::sys::path::replace_path_prefix(
Path, Entry.first, Entry.second))
82llvm::raw_string_ostream Out(
Result);
83Out << (OpenCLCPlusPlus ?
"C++ for OpenCL":
"OpenCL C") <<
" version " 90 constllvm::Triple &
T,
91std::vector<std::string> &Includes,
101Opts.AsmPreprocessor = 1;
110Opts.LineComment =
Std.hasLineComments();
111Opts.C99 =
Std.isC99();
112Opts.C11 =
Std.isC11();
113Opts.C17 =
Std.isC17();
114Opts.C23 =
Std.isC23();
115Opts.C2y =
Std.isC2y();
116Opts.CPlusPlus =
Std.isCPlusPlus();
117Opts.CPlusPlus11 =
Std.isCPlusPlus11();
118Opts.CPlusPlus14 =
Std.isCPlusPlus14();
119Opts.CPlusPlus17 =
Std.isCPlusPlus17();
120Opts.CPlusPlus20 =
Std.isCPlusPlus20();
121Opts.CPlusPlus23 =
Std.isCPlusPlus23();
122Opts.CPlusPlus26 =
Std.isCPlusPlus26();
123Opts.GNUMode =
Std.isGNUMode();
124Opts.GNUCVersion = 0;
125Opts.HexFloats =
Std.hasHexFloats();
126Opts.WChar =
Std.isCPlusPlus();
127Opts.Digraphs =
Std.hasDigraphs();
128Opts.RawStringLiterals =
Std.hasRawStringLiterals();
131 if(Opts.HLSL && Opts.IncludeDefaultHeader)
132Includes.push_back(
"hlsl.h");
135Opts.OpenCL =
Std.isOpenCL();
136 if(
LangStd== LangStandard::lang_opencl10)
137Opts.OpenCLVersion = 100;
138 else if(
LangStd== LangStandard::lang_opencl11)
139Opts.OpenCLVersion = 110;
140 else if(
LangStd== LangStandard::lang_opencl12)
141Opts.OpenCLVersion = 120;
142 else if(
LangStd== LangStandard::lang_opencl20)
143Opts.OpenCLVersion = 200;
144 else if(
LangStd== LangStandard::lang_opencl30)
145Opts.OpenCLVersion = 300;
146 else if(
LangStd== LangStandard::lang_openclcpp10)
147Opts.OpenCLCPlusPlusVersion = 100;
148 else if(
LangStd== LangStandard::lang_openclcpp2021)
149Opts.OpenCLCPlusPlusVersion = 202100;
150 else if(
LangStd== LangStandard::lang_hlsl2015)
152 else if(
LangStd== LangStandard::lang_hlsl2016)
154 else if(
LangStd== LangStandard::lang_hlsl2017)
156 else if(
LangStd== LangStandard::lang_hlsl2018)
158 else if(
LangStd== LangStandard::lang_hlsl2021)
160 else if(
LangStd== LangStandard::lang_hlsl202x)
162 else if(
LangStd== LangStandard::lang_hlsl202y)
170Opts.OpenCLCPlusPlus = Opts.CPlusPlus;
175 if(Opts.IncludeDefaultHeader) {
176 if(Opts.DeclareOpenCLBuiltins) {
178Includes.push_back(
"opencl-c-base.h");
180Includes.push_back(
"opencl-c.h");
197}
else if(Opts.CUDA) {
200Opts.OpenCLVersion = 200;
207Opts.Bool = Opts.OpenCL || Opts.CPlusPlus || Opts.C23;
210Opts.Half = Opts.OpenCL || Opts.HLSL;
212Opts.PreserveVec3Type = Opts.HLSL;
222#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ 223 if (get##NAME() != Base.get##NAME()) \ 224 OverrideMask |= NAME##Mask; 225#include "clang/Basic/FPOptions.def" 230#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ 231 llvm::errs() << "\n "#NAME " " << get##NAME();
232#include "clang/Basic/FPOptions.def" 233llvm::errs() <<
"\n";
237#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ 238 if (has##NAME##Override()) \ 239 llvm::errs() << "\n "#NAME " Override is " << get##NAME##Override();
240#include "clang/Basic/FPOptions.def" 241llvm::errs() <<
"\n";
Defines the clang::LangOptions interface.
Represents difference between two FPOptions values.
LLVM_DUMP_METHOD void dump()
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO)
Return the default value of FPOptions that's used when trailing storage isn't required.
LLVM_DUMP_METHOD void dump()
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
std::vector< std::string > XRayNeverInstrumentFiles
Paths to the XRay "never instrument" files specifying which objects (files, functions,...
bool isNoBuiltinFunc(StringRef Name) const
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* optio...
std::string getOpenCLVersionString() const
Return the OpenCL C or C++ for OpenCL language name and version as a string.
bool IsHeaderFile
Indicates whether the front-end is explicitly told that the input is a header file (i....
std::vector< std::string > XRayAlwaysInstrumentFiles
Paths to the XRay "always instrument" files specifying which objects (files, functions,...
VersionTuple getOpenCLVersionTuple() const
Return the OpenCL C or C++ version as a VersionTuple.
static void setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T, std::vector< std::string > &Includes, LangStandard::Kind LangStd=LangStandard::lang_unspecified)
Set language defaults for the given input language and language standard in the given LangOptions obj...
std::map< std::string, std::string, std::greater< std::string > > MacroPrefixMap
A prefix map for FILE, BASE_FILE and __builtin_FILE().
void remapPathPrefix(SmallVectorImpl< char > &Path) const
Remap path prefix according to -fmacro-prefix-path option.
LangStandard::Kind LangStd
The used language standard.
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
std::vector< std::string > NoSanitizeFiles
Paths to files specifying which objects (files, functions, variables) should not be instrumented.
std::string CurrentModule
The name of the current module, of which the main source file is a part.
The JSON file list parser is used to communicate input to InstallAPI.
LangStandard::Kind getDefaultLanguageStandard(clang::Language Lang, const llvm::Triple &T)
Language
The language for the input, used to select and validate the language standard and possible actions.
@ Asm
Assembly: we accept this only so that we can preprocess it.
@ Result
The result type of a method or function.
const FunctionProtoType * T
LangStandard - Information about the properties of a particular language standard.
static const LangStandard & getLangStandardForKind(Kind K)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4