LangOptions.h revision b0ff33a9f4b2a75b6949976bbf3782ff0d839cb1
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 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 30 unsigned CPlusPlus0x : 1; // C++0x Support 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 unsigned PascalStrings : 1; // Allow Pascal strings 38 unsigned Boolean : 1; // Allow bool/true/false 39 unsigned WritableStrings : 1; // Allow writable strings 40 unsigned LaxVectorConversions : 1; 41 42 LangOptions() { 43 Trigraphs = BCPLComment = DollarIdents = Digraphs = HexFloats = 0; 44 ObjC1 = ObjC2 = 0; 45 C99 = Microsoft = CPlusPlus = CPlusPlus0x = NoExtensions = 0; 46 CXXOperatorNames = PascalStrings = Boolean = WritableStrings = 0; 47 LaxVectorConversions = 0; 48 } 49}; 50 51} // end namespace clang 52 53#endif 54