summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Frontend/LangStandard.h26
-rw-r--r--clang/include/clang/Frontend/LangStandards.def12
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
3 files changed, 18 insertions, 22 deletions
diff --git a/clang/include/clang/Frontend/LangStandard.h b/clang/include/clang/Frontend/LangStandard.h
index cd92b269d30..ec32aa8d161 100644
--- a/clang/include/clang/Frontend/LangStandard.h
+++ b/clang/include/clang/Frontend/LangStandard.h
@@ -20,18 +20,17 @@ namespace frontend {
enum LangFeatures {
LineComment = (1 << 0),
- C89 = (1 << 1),
- C99 = (1 << 2),
- C11 = (1 << 3),
- CPlusPlus = (1 << 4),
- CPlusPlus11 = (1 << 5),
- CPlusPlus14 = (1 << 6),
- CPlusPlus1z = (1 << 7),
- Digraphs = (1 << 8),
- GNUMode = (1 << 9),
- HexFloat = (1 << 10),
- ImplicitInt = (1 << 11),
- OpenCL = (1 << 12)
+ C99 = (1 << 1),
+ C11 = (1 << 2),
+ CPlusPlus = (1 << 3),
+ CPlusPlus11 = (1 << 4),
+ CPlusPlus14 = (1 << 5),
+ CPlusPlus1z = (1 << 6),
+ Digraphs = (1 << 7),
+ GNUMode = (1 << 8),
+ HexFloat = (1 << 9),
+ ImplicitInt = (1 << 10),
+ OpenCL = (1 << 11)
};
}
@@ -64,9 +63,6 @@ public:
/// Language supports '//' comments.
bool hasLineComments() const { return Flags & frontend::LineComment; }
- /// isC89 - Language is a superset of C89.
- bool isC89() const { return Flags & frontend::C89; }
-
/// isC99 - Language is a superset of C99.
bool isC99() const { return Flags & frontend::C99; }
diff --git a/clang/include/clang/Frontend/LangStandards.def b/clang/include/clang/Frontend/LangStandards.def
index cc042bce0ac..ee0deaa2efb 100644
--- a/clang/include/clang/Frontend/LangStandards.def
+++ b/clang/include/clang/Frontend/LangStandards.def
@@ -31,24 +31,24 @@
// C89-ish modes.
LANGSTANDARD(c89, "c89",
C, "ISO C 1990",
- C89 | ImplicitInt)
+ ImplicitInt)
LANGSTANDARD(c90, "c90", C,
"ISO C 1990",
- C89 | ImplicitInt)
+ ImplicitInt)
LANGSTANDARD(iso9899_1990, "iso9899:1990",
C, "ISO C 1990",
- C89 | ImplicitInt)
+ ImplicitInt)
LANGSTANDARD(c94, "iso9899:199409",
C, "ISO C 1990 with amendment 1",
- C89 | Digraphs | ImplicitInt)
+ Digraphs | ImplicitInt)
LANGSTANDARD(gnu89, "gnu89",
C, "ISO C 1990 with GNU extensions",
- LineComment | C89 | Digraphs | GNUMode | ImplicitInt)
+ LineComment | Digraphs | GNUMode | ImplicitInt)
LANGSTANDARD(gnu90, "gnu90",
C, "ISO C 1990 with GNU extensions",
- LineComment | C89 | Digraphs | GNUMode | ImplicitInt)
+ LineComment | Digraphs | GNUMode | ImplicitInt)
// C99-ish modes
LANGSTANDARD(c99, "c99",
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dbbe6af6ab0..481ce5bfa62 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1615,7 +1615,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
Opts.CPlusPlus1z = Std.isCPlusPlus1z();
Opts.Digraphs = Std.hasDigraphs();
Opts.GNUMode = Std.isGNUMode();
- Opts.GNUInline = Std.isC89();
+ Opts.GNUInline = !Opts.C99 && !Opts.CPlusPlus;
Opts.HexFloats = Std.hasHexFloats();
Opts.ImplicitInt = Std.hasImplicitInt();
OpenPOWER on IntegriCloud