[cfe-commits] r39067 - in /cfe/cfe/trunk: Driver/PrintPreprocessedOutput.cpp Driver/clang.cpp Lex/Lexer.cpp Lex/PPExpressions.cpp Parse/ParseExpr.cpp include/clang/Basic/DiagnosticKinds.def include/clang/Basic/LangOptions.h include/clang/Basic/TokenKinds.def
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:27:16 PDT 2007
Author: sabre
Date: Wed Jul 11 11:27:16 2007
New Revision: 39067
URL: http://llvm.org/viewvc/llvm-project?rev=39067&view=rev
Log:
Remove GNU C++ min/max operator extension support, they have been removed
from gcc mainline.
Modified:
cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp
cfe/cfe/trunk/Driver/clang.cpp
cfe/cfe/trunk/Lex/Lexer.cpp
cfe/cfe/trunk/Lex/PPExpressions.cpp
cfe/cfe/trunk/Parse/ParseExpr.cpp
cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
cfe/cfe/trunk/include/clang/Basic/LangOptions.h
cfe/cfe/trunk/include/clang/Basic/TokenKinds.def
Modified: cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp (original)
+++ cfe/cfe/trunk/Driver/PrintPreprocessedOutput.cpp Wed Jul 11 11:27:16 2007
@@ -350,9 +350,6 @@
case tok::greaterequal: // >>=
case tok::caret: // ^=
case tok::equal: // ==
- case tok::lessquestion: // <?=
- case tok::greaterquestion: // >?=
- case tok::question: // <?=, >?=, check for <?= in case <? is disabled.
// Cases that concatenate only if the next char is =.
return FirstChar == '=';
}
Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:27:16 2007
@@ -258,8 +258,6 @@
// Fall through from newer standards to older ones. This isn't really right.
// FIXME: Enable specifically the right features based on the language stds.
case lang_gnucxx98:
- Options.CPPMinMax = 1;
- // FALL THROUGH.
case lang_cxx98:
Options.CPlusPlus = 1;
// FALL THROUGH.
Modified: cfe/cfe/trunk/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Lexer.cpp?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/Lexer.cpp (original)
+++ cfe/cfe/trunk/Lex/Lexer.cpp Wed Jul 11 11:27:16 2007
@@ -1374,16 +1374,6 @@
} else if (Features.Digraphs && Char == '>') {
Result.setKind(tok::l_brace); // '<%' -> '{'
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- } else if (Features.CPPMinMax && Char == '?') { // <?
- CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- Diag(BufferPtr, diag::min_max_deprecated);
-
- if (getCharAndSize(CurPtr, SizeTmp) == '=') { // <?=
- Result.setKind(tok::lessquestionequal);
- CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- } else {
- Result.setKind(tok::lessquestion);
- }
} else {
Result.setKind(tok::less);
}
@@ -1401,16 +1391,6 @@
} else if (Char == '>') {
Result.setKind(tok::greatergreater);
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- } else if (Features.CPPMinMax && Char == '?') {
- CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- Diag(BufferPtr, diag::min_max_deprecated);
-
- if (getCharAndSize(CurPtr, SizeTmp) == '=') {
- Result.setKind(tok::greaterquestionequal); // >?=
- CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
- } else {
- Result.setKind(tok::greaterquestion); // >?
- }
} else {
Result.setKind(tok::greater);
}
Modified: cfe/cfe/trunk/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/PPExpressions.cpp?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/PPExpressions.cpp (original)
+++ cfe/cfe/trunk/Lex/PPExpressions.cpp Wed Jul 11 11:27:16 2007
@@ -211,12 +211,11 @@
/// getPrecedence - Return the precedence of the specified binary operator
/// token. This returns:
/// ~0 - Invalid token.
-/// 15 - *,/,%
-/// 14 - -,+
-/// 13 - <<,>>
-/// 12 - >=, <=, >, <
-/// 11 - ==, !=
-/// 10 - <?, >? min, max (GCC extensions)
+/// 14 - *,/,%
+/// 13 - -,+
+/// 12 - <<,>>
+/// 11 - >=, <=, >, <
+/// 10 - ==, !=
/// 9 - &
/// 8 - ^
/// 7 - |
@@ -230,19 +229,17 @@
default: return ~0U;
case tok::percent:
case tok::slash:
- case tok::star: return 15;
+ case tok::star: return 14;
case tok::plus:
- case tok::minus: return 14;
+ case tok::minus: return 13;
case tok::lessless:
- case tok::greatergreater: return 13;
+ case tok::greatergreater: return 12;
case tok::lessequal:
case tok::less:
case tok::greaterequal:
- case tok::greater: return 12;
+ case tok::greater: return 11;
case tok::exclaimequal:
- case tok::equalequal: return 11;
- case tok::lessquestion:
- case tok::greaterquestion: return 10;
+ case tok::equalequal: return 10;
case tok::amp: return 9;
case tok::caret: return 8;
case tok::pipe: return 7;
@@ -335,12 +332,6 @@
case tok::greater: LHS = LHS > RHS; break;
case tok::exclaimequal: LHS = LHS != RHS; break;
case tok::equalequal: LHS = LHS == RHS; break;
- case tok::lessquestion: // Deprecation warning emitted by the lexer.
- LHS = std::min(LHS, RHS);
- break;
- case tok::greaterquestion: // Deprecation warning emitted by the lexer.
- LHS = std::max(LHS, RHS);
- break;
case tok::amp: LHS &= RHS; break;
case tok::caret: LHS ^= RHS; break;
case tok::pipe: LHS |= RHS; break;
Modified: cfe/cfe/trunk/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExpr.cpp?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:27:16 2007
@@ -42,12 +42,11 @@
InclusiveOr = 6, // |
ExclusiveOr = 7, // ^
And = 8, // &
- MinMax = 9, // <?, >? min, max (GCC extensions)
- Equality = 10, // ==, !=
- Relational = 11, // >=, <=, >, <
- Shift = 12, // <<, >>
- Additive = 13, // -, +
- Multiplicative = 14 // *, /, %
+ Equality = 9, // ==, !=
+ Relational = 10, // >=, <=, >, <
+ Shift = 11, // <<, >>
+ Additive = 12, // -, +
+ Multiplicative = 13 // *, /, %
};
}
@@ -76,8 +75,6 @@
case tok::pipe: return prec::InclusiveOr;
case tok::caret: return prec::ExclusiveOr;
case tok::amp: return prec::And;
- case tok::lessquestion:
- case tok::greaterquestion: return prec::MinMax;
case tok::exclaimequal:
case tok::equalequal: return prec::Equality;
case tok::lessequal:
Modified: cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Jul 11 11:27:16 2007
@@ -44,8 +44,6 @@
"\"/*\" within block comment")
DIAG(escaped_newline_block_comment_end, WARNING,
"escaped newline between */ characters at block comment end")
-DIAG(min_max_deprecated, WARNING,
- "minimum/maximum operators are deprecated")
DIAG(backslash_newline_space, WARNING,
"backslash and newline separated by space")
Modified: cfe/cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/LangOptions.h?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/cfe/trunk/include/clang/Basic/LangOptions.h Wed Jul 11 11:27:16 2007
@@ -28,7 +28,6 @@
unsigned C99 : 1; // C99 Support
unsigned Microsoft : 1; // Microsoft extensions.
unsigned CPlusPlus : 1; // C++ Support
- unsigned CPPMinMax : 1; // C++ <?=, >?= tokens.
unsigned NoExtensions : 1; // All extensions are disabled, strict mode.
unsigned ObjC1 : 1; // Objective C 1 support enabled.
@@ -39,7 +38,7 @@
LangOptions() {
Trigraphs = BCPLComment = DollarIdents = Digraphs = ObjC1 = ObjC2 = 0;
- C99 = Microsoft = CPlusPlus = CPPMinMax = NoExtensions = 0;
+ C99 = Microsoft = CPlusPlus = NoExtensions = 0;
KeepComments = KeepMacroComments = 0;
}
};
Modified: cfe/cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=39067&r1=39066&r2=39067&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/TokenKinds.def Wed Jul 11 11:27:16 2007
@@ -163,12 +163,6 @@
TOK(arrowstar) // ->*
TOK(coloncolon) // ::
-// GNU C++ Extensions
-TOK(lessquestionequal) // <?=
-TOK(greaterquestionequal)// >?=
-TOK(lessquestion) // <?
-TOK(greaterquestion) // >?
-
// Objective C support.
TOK(at) // @
More information about the cfe-commits
mailing list