clang API Documentation
00001 //===--- LangOptions.cpp - C Language Family Language Options ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines the LangOptions class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 #include "clang/Basic/LangOptions.h" 00014 00015 using namespace clang; 00016 00017 LangOptions::LangOptions() { 00018 #define LANGOPT(Name, Bits, Default, Description) Name = Default; 00019 #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default); 00020 #include "clang/Basic/LangOptions.def" 00021 } 00022 00023 void LangOptions::resetNonModularOptions() { 00024 #define LANGOPT(Name, Bits, Default, Description) 00025 #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default; 00026 #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ 00027 Name = Default; 00028 #include "clang/Basic/LangOptions.def" 00029 00030 // FIXME: This should not be reset; modules can be different with different 00031 // sanitizer options (this affects __has_feature(address_sanitizer) etc). 00032 Sanitize.clear(); 00033 SanitizerBlacklistFile.clear(); 00034 00035 CurrentModule.clear(); 00036 ImplementationOfModule.clear(); 00037 } 00038