llvm-project/clang/lib/Lex
Olivier Goffart 90f981bc5b Keep the IdentifierInfo in the Token for alternative operator keyword
The goal of this commit is to fix clang-format so it does not merge tokens when
using the alternative spelling keywords. (eg: "not foo" should not become "notfoo")

The problem is that Preprocessor::HandleIdentifier used to drop the identifier info
from the token for these keyword. This means the first condition of
TokenAnnotator::spaceRequiredBefore is not met. We could add explicit check for
the spelling in that condition, but I think it is better to keep the IdentifierInfo
and handle the operator keyword explicitly when needed. That actually leads to simpler
code, and probably slightly more efficient as well.

Another side effect of this change is that __identifier(and) will now work as
one would expect, removing a FIXME from the MicrosoftExtensions.cpp test

Differential Revision: https://reviews.llvm.org/D35172

llvm-svn: 308008
2017-07-14 09:23:40 +00:00
..
CMakeLists.txt
HeaderMap.cpp Use StringRef for MemoryBuffer identifier API (NFC) 2016-10-01 16:38:28 +00:00
HeaderSearch.cpp Support lazy stat'ing of files referenced by module maps. 2017-06-02 01:55:39 +00:00
Lexer.cpp Fix invalid warnings for header guards in preambles 2017-07-05 09:44:07 +00:00
LiteralSupport.cpp Added LLVM_FALLTHROUGH to address warning: this statement may fall through + formatted. NFC. 2017-06-03 06:25:29 +00:00
MacroArgs.cpp [Preprocessor]Correct Macro-Arg allocation of StringifiedArguments, 2017-06-14 23:09:01 +00:00
MacroInfo.cpp Remove unused tracking of owning module for MacroInfo objects. 2017-05-12 23:40:52 +00:00
ModuleMap.cpp Track the set of module maps read while building a .pcm file and reload those when preprocessing from that .pcm file. 2017-06-29 02:19:42 +00:00
PPCaching.cpp [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma 2017-02-24 17:45:16 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion. 2015-05-04 03:15:40 +00:00
PPDirectives.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
PPExpressions.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
PPLexerChange.cpp Fix invalid warnings for header guards in preambles 2017-07-05 09:44:07 +00:00
PPMacroExpansion.cpp [Sema] Allow unmarked overloadable functions. 2017-06-27 21:31:31 +00:00
PTHLexer.cpp Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC) 2016-10-11 07:31:29 +00:00
Pragma.cpp Support non-identifier module names when preprocessing modules. 2017-06-19 23:09:36 +00:00
PreprocessingRecord.cpp Revert "Revert "PPCallbacks::MacroUndefined, change signature and add test."" 2017-04-26 21:05:44 +00:00
Preprocessor.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
PreprocessorLexer.cpp
ScratchBuffer.cpp MSan told me that we actually dump the entire scratch buffer into PCH files, initialize it. 2015-04-06 20:01:49 +00:00
TokenConcatenation.cpp [PP] Replace some index based for loops with range based ones 2016-10-26 13:06:13 +00:00
TokenLexer.cpp Fix whitespace before token-paste of an argument. 2017-05-04 21:31:17 +00:00
UnicodeCharSets.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00