clang  3.9.0
LangOptions.cpp
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/StringRef.h"
15 
16 using namespace clang;
17 
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 }
23 
25 #define LANGOPT(Name, Bits, Default, Description)
26 #define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
27 #define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
28  Name = Default;
29 #include "clang/Basic/LangOptions.def"
30 
31  // FIXME: This should not be reset; modules can be different with different
32  // sanitizer options (this affects __has_feature(address_sanitizer) etc).
33  Sanitize.clear();
35 
36  CurrentModule.clear();
37 }
38 
39 bool LangOptions::isNoBuiltinFunc(const char *Name) const {
40  StringRef FuncName(Name);
41  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; ++i)
42  if (FuncName.equals(NoBuiltinFuncs[i]))
43  return true;
44  return false;
45 }
SanitizerSet Sanitize
Set of enabled sanitizers.
Definition: LangOptions.h:87
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Definition: Type.h:4549
bool isNoBuiltinFunc(const char *Name) const
Is this a libc/libm function that is no longer recognized as a builtin because a -fno-builtin-* optio...
Definition: LangOptions.cpp:39
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
Definition: LangOptions.cpp:24
std::string CurrentModule
The name of the current module, of which the main source file is a part.
Definition: LangOptions.h:107
void clear()
Disable all sanitizers.
Definition: Sanitizers.h:65
Defines the clang::LangOptions interface.
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
Definition: LangOptions.h:119
std::vector< std::string > SanitizerBlacklistFiles
Paths to blacklist files specifying which objects (files, functions, variables) should not be instrum...
Definition: LangOptions.h:91