//===- LangOptions.cpp - C Language Family Language Options ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the LangOptions class. // //===----------------------------------------------------------------------===// #include "clang/Basic/LangOptions.h" using namespace clang; LangOptions::LangOptions() : LangStd(LangStandard::lang_unspecified) { #define LANGOPT(Name, Bits, Default, Description) Name = Default; #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default); #include "clang/Basic/LangOptions.def" } void LangOptions::resetNonModularOptions() { #define LANGOPT(Name, Bits, Default, Description) #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default; #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ Name = static_cast(Default); #include "clang/Basic/LangOptions.def" // These options do not affect AST generation. NoSanitizeFiles.clear(); XRayAlwaysInstrumentFiles.clear(); XRayNeverInstrumentFiles.clear(); CurrentModule.clear(); IsHeaderFile = false; } bool LangOptions::isNoBuiltinFunc(StringRef FuncName) const { for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; ++i) if (FuncName.equals(NoBuiltinFuncs[i])) return true; return false; } VersionTuple LangOptions::getOpenCLVersionTuple() const { const int Ver = OpenCLCPlusPlus ? OpenCLCPlusPlusVersion : OpenCLVersion; return VersionTuple(Ver / 100, (Ver % 100) / 10); } FPOptions FPOptions::defaultWithoutTrailingStorage(const LangOptions &LO) { FPOptions result(LO); return result; } LLVM_DUMP_METHOD void FPOptions::dump() { #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ llvm::errs() << "\n " #NAME " " << get##NAME(); #include "clang/Basic/FPOptions.def" llvm::errs() << "\n"; } LLVM_DUMP_METHOD void FPOptionsOverride::dump() { #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ if (has##NAME##Override()) \ llvm::errs() << "\n " #NAME " Override is " << get##NAME##Override(); #include "clang/Basic/FPOptions.def" llvm::errs() << "\n"; } s='logheader'>2013-06-18Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.christos This was done so that boot blocks that want to compile both FFS and LFS in the same file work. 2012-04-12Use the same loop order for freeing as for allocation. Simpler code andjoerg easier to process for analyzers. 2011-07-01Fix memset usage.joerg 2009-08-06Define syscalls of lfs userspace tools (cleaner, mainly) throughpooka a struct called kernelops, which contains standard system calls for the normal case and rump system calls for the rump case. Make it possible to run the lfs cleaner in a library fashion (taking the quick route with the implementation). 2008-04-28Remove clause 3 and 4 from TNF licensesmartin 2007-10-08brelse() now takes two arguments.ad 2006-05-19Coverity CID 3766: Avoid null pointer derefchristos 2006-05-12Be more careful about checking return value of {m,re}alloc().perseant In determining when to stop reading segments when counting bytes (-b flag), total the sizes of the blocks we're actually writing instead of assuming they are all full blocks: many could be fragments or inode blocks. This increases the number of segments per Ifile write, markedly improving the efficiency of the cleaner in the small file case. 2006-04-01Coverity CID 2846: Don't use LIST_FOREACH if you are going to free the cursorchristos 2006-03-30A new version of the cleaner. In general, works about as well as the oldperseant cleaner, but with more legible code. Includes code for reading and writing to the raw disk device (so that an unmounted fs could be cleaned), for the use of a single daemon to clean multiple filesystems to save on resources, and for recording the old contents of cleaned segments to offline storage for regression testing of the LFS system as a whole; though these new features are not properly tested at this point.