llvm-project/clang/lib/Lex
Erich Keane 8691d6e678 [Preprocessor]Correct Macro-Arg allocation of StringifiedArguments,
correct getNumArguments

StringifiedArguments is allocated (resized) based on the size the 
getNumArguments function. However, this function ACTUALLY currently 
returns the amount of total UnexpArgTokens which is minimum the same as 
the new implementation of getNumMacroArguments, since empty/omitted arguments 
result in 1 UnexpArgToken, and included ones at minimum include 2 
(1 for the arg itself, 1 for eof).

This patch renames the otherwise unused getNumArguments to be more clear 
that it is the number of arguments that the Macro expects, and thus the maximum 
number that can be stringified. This patch also replaces the explicit memset 
(which results in value instantiation of the new tokens, PLUS clearing the 
memory) with brace initialization.

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

llvm-svn: 305425
2017-06-14 23:09:01 +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 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:25:47 +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 Support lazy stat'ing of files referenced by module maps. 2017-06-02 01:55:39 +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 [libclang] Introduce a new parsing option 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only. 2017-06-09 01:20:48 +00:00
PPExpressions.cpp Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-09-07 21:53:17 +00:00
PPLexerChange.cpp Allow for unfinished #if blocks in preambles 2017-05-30 11:54:55 +00:00
PPMacroExpansion.cpp Change __has_feature(objc_diagnose_if_attr) to __has_feature(attribute_diagnose_if_objc) for consistency with rest of attribute checks. 2017-05-24 01:38:00 +00:00
PTHLexer.cpp Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC) 2016-10-11 07:31:29 +00:00
Pragma.cpp Add #pragma clang module build/endbuild pragmas for performing a module build 2017-06-09 19:22:32 +00:00
PreprocessingRecord.cpp Revert "Revert "PPCallbacks::MacroUndefined, change signature and add test."" 2017-04-26 21:05:44 +00:00
Preprocessor.cpp Support operator keywords used in Windows SDK(fix ubsan) 2017-06-09 22:50:02 +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