blob: 2c87845b7b0e83c22bd99adc306d54794a3f3ce0 [file] [log] [blame]
Douglas Gregore289d812011-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 Gregor1c7e0472011-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 Gregor0f50b082011-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 Dietz4f45bc02013-01-18 11:30:38 +000029
Richard Smithd46b7ec2013-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).
Stephen Hines176edba2014-12-01 14:53:08 -080032 Sanitize.clear();
Stephen Hines0e2c34f2015-03-23 12:09:02 -070033 SanitizerBlacklistFiles.clear();
Will Dietz4f45bc02013-01-18 11:30:38 +000034
Douglas Gregorb86b8dc2011-11-15 19:35:01 +000035 CurrentModule.clear();
Stephen Hines176edba2014-12-01 14:53:08 -080036 ImplementationOfModule.clear();
Douglas Gregor1c7e0472011-09-13 20:44:41 +000037}
38