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 BCPLComment = (1 << 0),
26 CPlusPlus0x = (1 << 5),
30 ImplicitInt = (1 << 9)
35 /// LangStandard - Information about the properties of a particular language
39 #define LANGSTANDARD(id, name, desc, features) \
41 #include "clang/Frontend/LangStandards.def"
45 const char *ShortName;
46 const char *Description;
50 /// getName - Get the name of this standard.
51 const char *getName() const { return ShortName; }
53 /// getDescription - Get the description of this standard.
54 const char *getDescription() const { return Description; }
56 /// hasBCPLComments - Language supports '//' comments.
57 bool hasBCPLComments() const { return Flags & frontend::BCPLComment; }
59 /// isC89 - Language is a superset of C89.
60 bool isC89() const { return Flags & frontend::C89; }
62 /// isC99 - Language is a superset of C99.
63 bool isC99() const { return Flags & frontend::C99; }
65 /// isC1X - Language is a superset of C1X.
66 bool isC1X() const { return Flags & frontend::C1X; }
68 /// isCPlusPlus - Language is a C++ variant.
69 bool isCPlusPlus() const { return Flags & frontend::CPlusPlus; }
71 /// isCPlusPlus0x - Language is a C++0x variant.
72 bool isCPlusPlus0x() const { return Flags & frontend::CPlusPlus0x; }
74 /// hasDigraphs - Language supports digraphs.
75 bool hasDigraphs() const { return Flags & frontend::Digraphs; }
77 /// isGNUMode - Language includes GNU extensions.
78 bool isGNUMode() const { return Flags & frontend::GNUMode; }
80 /// hasHexFloats - Language supports hexadecimal float constants.
81 bool hasHexFloats() const { return Flags & frontend::HexFloat; }
83 /// hasImplicitInt - Language allows variables to be typed as int implicitly.
84 bool hasImplicitInt() const { return Flags & frontend::ImplicitInt; }
86 static const LangStandard &getLangStandardForKind(Kind K);
87 static const LangStandard *getLangStandardForName(StringRef Name);
90 } // end namespace clang