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 "llvm/ADT/StringRef.h"
20 BCPLComment = (1 << 0),
25 CPlusPlus0x = (1 << 5),
29 ImplicitInt = (1 << 9)
34 /// LangStandard - Information about the properties of a particular language
38 #define LANGSTANDARD(id, name, desc, features) \
40 #include "clang/Frontend/LangStandards.def"
44 const char *ShortName;
45 const char *Description;
49 /// getName - Get the name of this standard.
50 const char *getName() const { return ShortName; }
52 /// getDescription - Get the description of this standard.
53 const char *getDescription() const { return Description; }
55 /// hasBCPLComments - Language supports '//' comments.
56 bool hasBCPLComments() const { return Flags & frontend::BCPLComment; }
58 /// isC89 - Language is a superset of C89.
59 bool isC89() const { return Flags & frontend::C89; }
61 /// isC99 - Language is a superset of C99.
62 bool isC99() const { return Flags & frontend::C99; }
64 /// isC1X - Language is a superset of C1X.
65 bool isC1X() const { return Flags & frontend::C1X; }
67 /// isCPlusPlus - Language is a C++ variant.
68 bool isCPlusPlus() const { return Flags & frontend::CPlusPlus; }
70 /// isCPlusPlus0x - Language is a C++0x variant.
71 bool isCPlusPlus0x() const { return Flags & frontend::CPlusPlus0x; }
73 /// hasDigraphs - Language supports digraphs.
74 bool hasDigraphs() const { return Flags & frontend::Digraphs; }
76 /// isGNUMode - Language includes GNU extensions.
77 bool isGNUMode() const { return Flags & frontend::GNUMode; }
79 /// hasHexFloats - Language supports hexadecimal float constants.
80 bool hasHexFloats() const { return Flags & frontend::HexFloat; }
82 /// hasImplicitInt - Language allows variables to be typed as int implicitly.
83 bool hasImplicitInt() const { return Flags & frontend::ImplicitInt; }
85 static const LangStandard &getLangStandardForKind(Kind K);
86 static const LangStandard *getLangStandardForName(llvm::StringRef Name);
89 } // end namespace clang