LangOptions.cpp 1.3 KB

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