1 //===--- LangStandard.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_FRONTEND_LANGSTANDARD_H
11 #define LLVM_CLANG_FRONTEND_LANGSTANDARD_H
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
21 LineComment = (1 << 0),
26 CPlusPlus11 = (1 << 5),
27 CPlusPlus1y = (1 << 6),
31 ImplicitInt = (1 << 10)
36 /// LangStandard - Information about the properties of a particular language
40 #define LANGSTANDARD(id, name, desc, features) \
42 #include "clang/Frontend/LangStandards.def"
46 const char *ShortName;
47 const char *Description;
51 /// getName - Get the name of this standard.
52 const char *getName() const { return ShortName; }
54 /// getDescription - Get the description of this standard.
55 const char *getDescription() const { return Description; }
57 /// Language supports '//' comments.
58 bool hasLineComments() const { return Flags & frontend::LineComment; }
60 /// isC89 - Language is a superset of C89.
61 bool isC89() const { return Flags & frontend::C89; }
63 /// isC99 - Language is a superset of C99.
64 bool isC99() const { return Flags & frontend::C99; }
66 /// isC11 - Language is a superset of C11.
67 bool isC11() const { return Flags & frontend::C11; }
69 /// isCPlusPlus - Language is a C++ variant.
70 bool isCPlusPlus() const { return Flags & frontend::CPlusPlus; }
72 /// isCPlusPlus11 - Language is a C++0x variant.
73 bool isCPlusPlus11() const { return Flags & frontend::CPlusPlus11; }
75 /// isCPlusPlus1y - Language is a C++1y variant.
76 bool isCPlusPlus1y() const { return Flags & frontend::CPlusPlus1y; }
78 /// hasDigraphs - Language supports digraphs.
79 bool hasDigraphs() const { return Flags & frontend::Digraphs; }
81 /// isGNUMode - Language includes GNU extensions.
82 bool isGNUMode() const { return Flags & frontend::GNUMode; }
84 /// hasHexFloats - Language supports hexadecimal float constants.
85 bool hasHexFloats() const { return Flags & frontend::HexFloat; }
87 /// hasImplicitInt - Language allows variables to be typed as int implicitly.
88 bool hasImplicitInt() const { return Flags & frontend::ImplicitInt; }
90 static const LangStandard &getLangStandardForKind(Kind K);
91 static const LangStandard *getLangStandardForName(StringRef Name);
94 } // end namespace clang