blob: a2d07f0e448e678566f42504b140b1541f25e25b [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- LangOptions.h - C Language Family Language Options -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the LangOptions interface.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LANGOPTIONS_H
15#define LLVM_CLANG_LANGOPTIONS_H
16
17namespace clang {
18
19/// LangOptions - This class keeps track of the various options that can be
20/// enabled, which controls the dialect of C that is accepted.
21struct LangOptions {
22 unsigned Trigraphs : 1; // Trigraphs in source files.
23 unsigned BCPLComment : 1; // BCPL-style // comments.
24 unsigned DollarIdents : 1; // '$' allowed in identifiers.
25 unsigned Digraphs : 1; // When added to C? C99?
26 unsigned HexFloats : 1; // C99 Hexadecimal float constants.
27 unsigned C99 : 1; // C99 Support
28 unsigned Microsoft : 1; // Microsoft extensions.
29 unsigned CPlusPlus : 1; // C++ Support
Chris Lattnerd4b80f12007-07-16 04:18:29 +000030 unsigned CPlusPlus0x : 1; // C++0x Support
Reid Spencer5f016e22007-07-11 17:01:13 +000031 unsigned NoExtensions : 1; // All extensions are disabled, strict mode.
32 unsigned CXXOperatorNames : 1; // Treat C++ operator names as keywords.
33
34 unsigned ObjC1 : 1; // Objective C 1 support enabled.
35 unsigned ObjC2 : 1; // Objective C 2 support enabled.
36
37 LangOptions() {
38 Trigraphs = BCPLComment = DollarIdents = Digraphs = ObjC1 = ObjC2 = 0;
Chris Lattnerd4b80f12007-07-16 04:18:29 +000039 C99 = Microsoft = CPlusPlus = CPlusPlus0x = NoExtensions = 0;
40 CXXOperatorNames = 0;
Reid Spencer5f016e22007-07-11 17:01:13 +000041 }
42};
43
44} // end namespace clang
45
46#endif