xref: /minix3/external/bsd/llvm/dist/clang/lib/Basic/LangOptions.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc //===--- LangOptions.cpp - C Language Family Language Options ---*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc //  This file defines the LangOptions class.
11f4a2713aSLionel Sambuc //
12f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
13f4a2713aSLionel Sambuc #include "clang/Basic/LangOptions.h"
14f4a2713aSLionel Sambuc 
15f4a2713aSLionel Sambuc using namespace clang;
16f4a2713aSLionel Sambuc 
LangOptions()17f4a2713aSLionel Sambuc LangOptions::LangOptions() {
18f4a2713aSLionel Sambuc #define LANGOPT(Name, Bits, Default, Description) Name = Default;
19f4a2713aSLionel Sambuc #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20f4a2713aSLionel Sambuc #include "clang/Basic/LangOptions.def"
21f4a2713aSLionel Sambuc }
22f4a2713aSLionel Sambuc 
resetNonModularOptions()23f4a2713aSLionel Sambuc void LangOptions::resetNonModularOptions() {
24f4a2713aSLionel Sambuc #define LANGOPT(Name, Bits, Default, Description)
25f4a2713aSLionel Sambuc #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
26f4a2713aSLionel Sambuc #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27f4a2713aSLionel Sambuc   Name = Default;
28f4a2713aSLionel Sambuc #include "clang/Basic/LangOptions.def"
29f4a2713aSLionel Sambuc 
30f4a2713aSLionel Sambuc   // FIXME: This should not be reset; modules can be different with different
31f4a2713aSLionel Sambuc   // sanitizer options (this affects __has_feature(address_sanitizer) etc).
32*0a6a1f1dSLionel Sambuc   Sanitize.clear();
33*0a6a1f1dSLionel Sambuc   SanitizerBlacklistFile.clear();
34f4a2713aSLionel Sambuc 
35f4a2713aSLionel Sambuc   CurrentModule.clear();
36*0a6a1f1dSLionel Sambuc   ImplementationOfModule.clear();
37f4a2713aSLionel Sambuc }
38f4a2713aSLionel Sambuc 
39