Remove unnecessary and somewhat inaccurate "C89" flag from language standards.

llvm-svn: 301500
This commit is contained in:
Richard Smith 2017-04-26 23:49:57 +00:00
parent aa1d602fbd
commit 6379cfc553
3 changed files with 18 additions and 22 deletions

View File

@ -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; }

View File

@ -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",

View File

@ -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();