Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 1 | //===--- 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 | |
| 15 | using namespace clang; |
| 16 | |
Will Dietz | 4f45bc0 | 2013-01-18 11:30:38 +0000 | [diff] [blame] | 17 | const SanitizerOptions SanitizerOptions::Disabled = {}; |
| 18 | |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 19 | LangOptions::LangOptions() { |
| 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" |
Will Dietz | 4f45bc0 | 2013-01-18 11:30:38 +0000 | [diff] [blame] | 23 | |
| 24 | Sanitize = SanitizerOptions::Disabled; |
Douglas Gregor | e289d81 | 2011-09-13 17:21:33 +0000 | [diff] [blame] | 25 | } |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 26 | |
| 27 | void LangOptions::resetNonModularOptions() { |
| 28 | #define LANGOPT(Name, Bits, Default, Description) |
| 29 | #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default; |
Douglas Gregor | 0f50b08 | 2011-09-15 14:56:27 +0000 | [diff] [blame] | 30 | #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ |
| 31 | Name = Default; |
| 32 | #include "clang/Basic/LangOptions.def" |
Will Dietz | 4f45bc0 | 2013-01-18 11:30:38 +0000 | [diff] [blame] | 33 | |
Richard Smith | d46b7ec | 2013-02-07 01:09:29 +0000 | [diff] [blame] | 34 | // FIXME: This should not be reset; modules can be different with different |
| 35 | // sanitizer options (this affects __has_feature(address_sanitizer) etc). |
Will Dietz | 4f45bc0 | 2013-01-18 11:30:38 +0000 | [diff] [blame] | 36 | Sanitize = SanitizerOptions::Disabled; |
| 37 | |
Douglas Gregor | b86b8dc | 2011-11-15 19:35:01 +0000 | [diff] [blame] | 38 | CurrentModule.clear(); |
Douglas Gregor | 1c7e047 | 2011-09-13 20:44:41 +0000 | [diff] [blame] | 39 | } |
| 40 | |