Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- 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 | |
| 17 | namespace 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. |
| 21 | struct 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 Lattner | d4b80f1 | 2007-07-16 04:18:29 +0000 | [diff] [blame^] | 30 | unsigned CPlusPlus0x : 1; // C++0x Support |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 31 | 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 Lattner | d4b80f1 | 2007-07-16 04:18:29 +0000 | [diff] [blame^] | 39 | C99 = Microsoft = CPlusPlus = CPlusPlus0x = NoExtensions = 0; |
| 40 | CXXOperatorNames = 0; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 41 | } |
| 42 | }; |
| 43 | |
| 44 | } // end namespace clang |
| 45 | |
| 46 | #endif |