LangOptions.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. ///////////////////////////////////////////////////////////////////////////////
  16. using namespace clang;
  17. LangOptions::LangOptions() {
  18. #ifdef MS_SUPPORT_VARIABLE_LANGOPTS
  19. #define LANGOPT(Name, Bits, Default, Description) Name = Default;
  20. #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) set##Name(Default);
  21. #include "clang/Basic/LangOptions.def"
  22. #endif
  23. }
  24. void LangOptions::resetNonModularOptions() {
  25. #ifdef MS_SUPPORT_VARIABLE_LANGOPTS
  26. #define LANGOPT(Name, Bits, Default, Description)
  27. #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
  28. #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
  29. Name = Default;
  30. #include "clang/Basic/LangOptions.def"
  31. #endif
  32. // FIXME: This should not be reset; modules can be different with different
  33. // sanitizer options (this affects __has_feature(address_sanitizer) etc).
  34. Sanitize.clear();
  35. SanitizerBlacklistFiles.clear();
  36. CurrentModule.clear();
  37. ImplementationOfModule.clear();
  38. }