 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
100.0% |
8 / 8 |
| |
 |
|
 |
1 : //===--- LangStandard.h -----------------------------------------*- C++ -*-===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 :
10 : #ifndef LLVM_CLANG_FRONTEND_LANGSTANDARD_H
11 : #define LLVM_CLANG_FRONTEND_LANGSTANDARD_H
12 :
13 : #include "llvm/ADT/StringRef.h"
14 :
15 : namespace clang {
16 :
17 : namespace frontend {
18 :
19 : enum LangFeatures {
20 : BCPLComment = (1 << 0),
21 : C99 = (1 << 1),
22 : CPlusPlus = (1 << 2),
23 : CPlusPlus0x = (1 << 3),
24 : Digraphs = (1 << 4),
25 : GNUMode = (1 << 5),
26 : HexFloat = (1 << 6),
27 : ImplicitInt = (1 << 7)
28 : };
29 :
30 : }
31 :
32 : /// LangStandard - Information about the properties of a particular language
33 : /// standard.
34 : struct LangStandard {
35 : enum Kind {
36 : #define LANGSTANDARD(id, name, desc, features) \
37 : lang_##id,
38 : #include "clang/Frontend/LangStandards.def"
39 : lang_unspecified
40 : };
41 :
42 : const char *ShortName;
43 : const char *Description;
44 : unsigned Flags;
45 :
46 : public:
47 : /// getName - Get the name of this standard.
48 : const char *getName() const { return ShortName; }
49 :
50 : /// getDescription - Get the description of this standard.
51 : const char *getDescription() const { return Description; }
52 :
53 : /// hasBCPLComments - Language supports '//' comments.
54 2521: bool hasBCPLComments() const { return Flags & frontend::BCPLComment; }
55 :
56 : /// isC99 - Language is a superset of C99.
57 5042: bool isC99() const { return Flags & frontend::C99; }
58 :
59 : /// isCPlusPlus - Language is a C++ variant.
60 2521: bool isCPlusPlus() const { return Flags & frontend::CPlusPlus; }
61 :
62 : /// isCPlusPlus0x - Language is a C++0x variant.
63 2521: bool isCPlusPlus0x() const { return Flags & frontend::CPlusPlus0x; }
64 :
65 : /// hasDigraphs - Language supports digraphs.
66 2521: bool hasDigraphs() const { return Flags & frontend::Digraphs; }
67 :
68 : /// isGNUMode - Language includes GNU extensions.
69 2521: bool isGNUMode() const { return Flags & frontend::GNUMode; }
70 :
71 : /// hasHexFloats - Language supports hexadecimal float constants.
72 2521: bool hasHexFloats() const { return Flags & frontend::HexFloat; }
73 :
74 : /// hasImplicitInt - Language allows variables to be typed as int implicitly.
75 2521: bool hasImplicitInt() const { return Flags & frontend::ImplicitInt; }
76 :
77 : static const LangStandard &getLangStandardForKind(Kind K);
78 : static const LangStandard *getLangStandardForName(llvm::StringRef Name);
79 : };
80 :
81 : } // end namespace clang
82 :
83 : #endif
Generated: 2010-02-10 01:31 by zcov