[cfe-commits] r39245 - in /cfe/cfe/trunk: Driver/clang.cpp Lex/IdentifierTable.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:41:50 PDT 2007
Author: sabre
Date: Wed Jul 11 11:41:50 2007
New Revision: 39245
URL: http://llvm.org/viewvc/llvm-project?rev=39245&view=rev
Log:
Add support for -fno-operator-names, patch by Bill.
Modified:
cfe/cfe/trunk/Driver/clang.cpp
cfe/cfe/trunk/Lex/IdentifierTable.cpp
Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39245&r1=39244&r2=39245&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:41:50 2007
@@ -233,6 +233,11 @@
"extensions (default for C++)"),
clEnumValEnd));
+static cl::opt<bool>
+NoOperatorNames("fno-operator-names",
+ cl::desc("Do not treat C++ operator name keywords as "
+ "synonyms for operators"));
+
// FIXME: add:
// -ansi
// -trigraphs
@@ -265,6 +270,7 @@
case lang_gnucxx98:
case lang_cxx98:
Options.CPlusPlus = 1;
+ Options.CXXOperatorNames = !NoOperatorNames;
// FALL THROUGH.
case lang_gnu99:
case lang_c99:
Modified: cfe/cfe/trunk/Lex/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/IdentifierTable.cpp?rev=39245&r1=39244&r2=39245&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/IdentifierTable.cpp (original)
+++ cfe/cfe/trunk/Lex/IdentifierTable.cpp Wed Jul 11 11:41:50 2007
@@ -131,7 +131,7 @@
#define PPKEYWORD(NAME) \
AddPPKeyword(tok::pp_##NAME, #NAME, strlen(#NAME), *this);
#define CXX_KEYWORD_OPERATOR(NAME, ALIAS) \
- if (LangOpts.CPlusPlus) \
+ if (LangOpts.CXXOperatorNames) \
AddCXXOperatorKeyword(#NAME, strlen(#NAME), tok::ALIAS, *this);
#define OBJC1_AT_KEYWORD(NAME) \
if (LangOpts.ObjC1) \
More information about the cfe-commits
mailing list