blob: dcbd22817111329cf6fb1ff96757654564beb750 [file] [log] [blame]
Douglas Gregor79a91412011-09-13 17:21:33 +00001//===--- LangOptions.cpp - C Language Family Language Options ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the LangOptions class.
11//
12//===----------------------------------------------------------------------===//
13#include "clang/Basic/LangOptions.h"
14
15using namespace clang;
16
17LangOptions::LangOptions() {
18#define LANGOPT(Name, Bits, Default, Description) Name = Default;
19#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
20#include "clang/Basic/LangOptions.def"
21}
Douglas Gregorf1312a82011-09-13 20:44:41 +000022
23void LangOptions::resetNonModularOptions() {
24#define LANGOPT(Name, Bits, Default, Description)
25#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
Douglas Gregor8455e762011-09-15 14:56:27 +000026#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
27 Name = Default;
28#include "clang/Basic/LangOptions.def"
Will Dietzf54319c2013-01-18 11:30:38 +000029
Richard Smithfc567462013-02-07 01:09:29 +000030 // FIXME: This should not be reset; modules can be different with different
31 // sanitizer options (this affects __has_feature(address_sanitizer) etc).
Alexey Samsonov035462c2014-10-30 19:33:44 +000032 Sanitize.clear();
Alexey Samsonova0416102014-11-11 01:26:14 +000033 SanitizerBlacklistFile.clear();
Will Dietzf54319c2013-01-18 11:30:38 +000034
Douglas Gregor7d106e42011-11-15 19:35:01 +000035 CurrentModule.clear();
Ben Langmuirb537a3a2014-07-23 15:30:23 +000036 ImplementationOfModule.clear();
Douglas Gregorf1312a82011-09-13 20:44:41 +000037}
38