opnsense-src/include/clang/Basic/LangOptions.h

195 lines
7.6 KiB
C
Raw Normal View History

2009-06-02 13:58:47 -04:00
//===--- LangOptions.h - C Language Family Language Options -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the LangOptions interface.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LANGOPTIONS_H
#define LLVM_CLANG_LANGOPTIONS_H
2009-12-01 06:08:04 -05:00
#include <string>
2009-06-02 13:58:47 -04:00
namespace clang {
/// LangOptions - This class keeps track of the various options that can be
/// enabled, which controls the dialect of C that is accepted.
class LangOptions {
public:
unsigned Trigraphs : 1; // Trigraphs in source files.
unsigned BCPLComment : 1; // BCPL-style '//' comments.
2009-07-04 09:58:54 -04:00
unsigned Bool : 1; // 'bool', 'true', 'false' keywords.
2009-06-02 13:58:47 -04:00
unsigned DollarIdents : 1; // '$' allowed in identifiers.
unsigned AsmPreprocessor : 1; // Preprocessor in asm mode.
unsigned GNUMode : 1; // True in gnu99 mode false in c99 mode (etc)
unsigned ImplicitInt : 1; // C89 implicit 'int'.
unsigned Digraphs : 1; // C94, C99 and C++
unsigned HexFloats : 1; // C99 Hexadecimal float constants.
unsigned C99 : 1; // C99 Support
unsigned Microsoft : 1; // Microsoft extensions.
unsigned CPlusPlus : 1; // C++ Support
unsigned CPlusPlus0x : 1; // C++0x Support
unsigned CXXOperatorNames : 1; // Treat C++ operator names as keywords.
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
unsigned ObjC1 : 1; // Objective-C 1 support enabled.
unsigned ObjC2 : 1; // Objective-C 2 support enabled.
unsigned ObjCNonFragileABI : 1; // Objective-C modern abi enabled
2010-02-16 04:31:36 -05:00
unsigned ObjCNonFragileABI2 : 1; // Objective-C enhanced modern abi enabled
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
unsigned PascalStrings : 1; // Allow Pascal strings
unsigned WritableStrings : 1; // Allow writable strings
unsigned LaxVectorConversions : 1;
2009-06-27 06:45:02 -04:00
unsigned AltiVec : 1; // Support AltiVec-style vector initializers.
2009-06-02 13:58:47 -04:00
unsigned Exceptions : 1; // Support exception handling.
2010-02-16 04:31:36 -05:00
unsigned SjLjExceptions : 1; // Use setjmp-longjump exception handling.
2009-12-15 13:49:47 -05:00
unsigned RTTI : 1; // Support RTTI information.
2009-06-02 13:58:47 -04:00
unsigned NeXTRuntime : 1; // Use NeXT runtime.
unsigned Freestanding : 1; // Freestanding implementation
unsigned NoBuiltin : 1; // Do not use builtin functions (-fno-builtin)
unsigned ThreadsafeStatics : 1; // Whether static initializers are protected
// by locks.
2009-10-14 14:03:49 -04:00
unsigned POSIXThreads : 1; // Compiling with POSIX thread support
// (-pthread)
2009-06-02 13:58:47 -04:00
unsigned Blocks : 1; // block extension to C
2009-11-18 09:59:57 -05:00
unsigned BlockIntrospection: 1; // block have ObjC type encodings.
2009-06-02 13:58:47 -04:00
unsigned EmitAllDecls : 1; // Emit all declarations, even if
// they are unused.
unsigned MathErrno : 1; // Math functions must respect errno
// (modulo the platform support).
unsigned OverflowChecking : 1; // Extension to call a handler function when
// signed integer arithmetic overflows.
unsigned HeinousExtensions : 1; // Extensions that we really don't like and
// may be ripped out at any time.
unsigned Optimize : 1; // Whether __OPTIMIZE__ should be defined.
2009-10-14 14:03:49 -04:00
unsigned OptimizeSize : 1; // Whether __OPTIMIZE_SIZE__ should be
2009-06-02 13:58:47 -04:00
// defined.
unsigned Static : 1; // Should __STATIC__ be defined (as
// opposed to __DYNAMIC__).
unsigned PICLevel : 2; // The value for __PIC__, if non-zero.
unsigned GNUInline : 1; // Should GNU inline semantics be
// used (instead of C99 semantics).
unsigned NoInline : 1; // Should __NO_INLINE__ be defined.
unsigned ObjCGCBitmapPrint : 1; // Enable printing of gc's bitmap layout
// for __weak/__strong ivars.
2009-10-14 14:03:49 -04:00
unsigned AccessControl : 1; // Whether C++ access control should
2009-06-02 13:58:47 -04:00
// be enabled.
2009-06-06 04:21:31 -04:00
unsigned CharIsSigned : 1; // Whether char is a signed or unsigned type
2009-11-18 09:59:57 -05:00
unsigned ShortWChar : 1; // Force wchar_t to be unsigned short int.
2009-06-27 06:45:02 -04:00
unsigned OpenCL : 1; // OpenCL C99 language extensions.
2010-01-01 05:34:51 -05:00
unsigned AssumeSaneOperatorNew : 1; // Whether to add __attribute__((malloc))
// to the declaration of C++'s new
// operators
2009-10-14 14:03:49 -04:00
unsigned ElideConstructors : 1; // Whether C++ copy constructors should be
// elided if possible.
2010-02-16 04:31:36 -05:00
unsigned CatchUndefined : 1; // Generate code to check for undefined ops.
unsigned DumpVtableLayouts : 1; // Dump the layouts of all the emitted
// vtables.
2009-06-02 13:58:47 -04:00
private:
2009-07-04 09:58:54 -04:00
unsigned GC : 2; // Objective-C Garbage Collection modes. We
// declare this enum as unsigned because MSVC
// insists on making enums signed. Set/Query
// this value using accessors.
2009-06-02 13:58:47 -04:00
unsigned SymbolVisibility : 3; // Symbol's visibility.
2009-07-04 09:58:54 -04:00
unsigned StackProtector : 2; // Whether stack protectors are on. We declare
// this enum as unsigned because MSVC insists
// on making enums signed. Set/Query this
// value using accessors.
2009-06-02 13:58:47 -04:00
2009-10-14 14:03:49 -04:00
public:
2009-06-02 13:58:47 -04:00
unsigned InstantiationDepth; // Maximum template instantiation depth.
2009-12-01 06:08:04 -05:00
std::string ObjCConstantStringClass;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
enum GCMode { NonGC, GCOnly, HybridGC };
2009-07-04 09:58:54 -04:00
enum StackProtectorMode { SSPOff, SSPOn, SSPReq };
2009-10-14 14:03:49 -04:00
enum VisibilityMode {
Default,
Protected,
2009-06-02 13:58:47 -04:00
Hidden
};
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
LangOptions() {
2009-07-04 09:58:54 -04:00
Trigraphs = BCPLComment = Bool = DollarIdents = AsmPreprocessor = 0;
2009-06-02 13:58:47 -04:00
GNUMode = ImplicitInt = Digraphs = 0;
HexFloats = 0;
2010-02-16 04:31:36 -05:00
GC = ObjC1 = ObjC2 = ObjCNonFragileABI = ObjCNonFragileABI2 = 0;
2009-06-02 13:58:47 -04:00
C99 = Microsoft = CPlusPlus = CPlusPlus0x = 0;
CXXOperatorNames = PascalStrings = WritableStrings = 0;
2010-02-16 04:31:36 -05:00
Exceptions = SjLjExceptions = Freestanding = NoBuiltin = 0;
2009-11-18 09:59:57 -05:00
NeXTRuntime = 1;
2009-12-15 13:49:47 -05:00
RTTI = 1;
2009-06-02 13:58:47 -04:00
LaxVectorConversions = 1;
HeinousExtensions = 0;
2009-07-04 09:58:54 -04:00
AltiVec = OpenCL = StackProtector = 0;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
SymbolVisibility = (unsigned) Default;
2009-10-14 14:03:49 -04:00
2010-02-16 04:31:36 -05:00
ThreadsafeStatics = 1;
2009-10-14 14:03:49 -04:00
POSIXThreads = 0;
2009-06-02 13:58:47 -04:00
Blocks = 0;
2009-11-18 09:59:57 -05:00
BlockIntrospection = 0;
2009-06-02 13:58:47 -04:00
EmitAllDecls = 0;
MathErrno = 1;
2010-01-01 05:34:51 -05:00
AssumeSaneOperatorNew = 1;
2009-06-02 13:58:47 -04:00
// FIXME: The default should be 1.
AccessControl = 0;
2009-10-14 14:03:49 -04:00
ElideConstructors = 1;
2009-06-02 13:58:47 -04:00
OverflowChecking = 0;
ObjCGCBitmapPrint = 0;
InstantiationDepth = 99;
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
Optimize = 0;
OptimizeSize = 0;
Static = 0;
PICLevel = 0;
GNUInline = 0;
NoInline = 0;
2009-06-06 04:21:31 -04:00
CharIsSigned = 1;
2009-11-18 09:59:57 -05:00
ShortWChar = 0;
2009-12-15 13:49:47 -05:00
CatchUndefined = 0;
2010-02-16 04:31:36 -05:00
DumpVtableLayouts = 0;
2009-06-02 13:58:47 -04:00
}
2009-10-14 14:03:49 -04:00
2009-06-02 13:58:47 -04:00
GCMode getGCMode() const { return (GCMode) GC; }
void setGCMode(GCMode m) { GC = (unsigned) m; }
2009-07-04 09:58:54 -04:00
StackProtectorMode getStackProtectorMode() const {
return static_cast<StackProtectorMode>(StackProtector);
}
void setStackProtectorMode(StackProtectorMode m) {
StackProtector = static_cast<unsigned>(m);
}
2009-10-14 14:03:49 -04:00
VisibilityMode getVisibilityMode() const {
return (VisibilityMode) SymbolVisibility;
2009-06-02 13:58:47 -04:00
}
void setVisibilityMode(VisibilityMode v) { SymbolVisibility = (unsigned) v; }
};
} // end namespace clang
#endif