llvm-project/clang/lib
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
..
ARCMigrate Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:23:19 +00:00
AST AST: Add missing break at end of switch 2017-06-14 21:26:31 +00:00
ASTMatchers [ASTMatchers] Fix use after free. 2017-06-09 17:55:42 +00:00
Analysis Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:23:51 +00:00
Basic Define _GNU_SOURCE for rtems c++ 2017-06-14 17:01:18 +00:00
CodeGen Preserve cold attribute for function decls 2017-06-13 21:14:07 +00:00
Driver Revert r305164/5/7. 2017-06-12 08:08:18 +00:00
Edit [clang] Fix format specifiers fixits 2017-06-08 21:44:45 +00:00
Format clang-format: Add CompactNamespaces option 2017-06-14 12:29:47 +00:00
Frontend Be more strict when checking the -flto option value 2017-06-14 15:37:11 +00:00
FrontendTool Add -frewrite-imports flag. 2017-06-09 21:24:02 +00:00
Headers [DOXYGEN] Corrected several typos and incorrect parameters description that Sony's techinical writer found during review. 2017-06-06 22:58:01 +00:00
Index [index] The references to explicit class properties should be recorded 2017-05-24 14:23:40 +00:00
Lex [Preprocessor]Correct Macro-Arg allocation of StringifiedArguments, 2017-06-14 23:09:01 +00:00
Parse PR33318: Add missing full-expression checking to static_assert expression. 2017-06-06 01:34:24 +00:00
Rewrite Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:29:40 +00:00
Sema Reverted 305379 (Function with unparsed body is a definition) 2017-06-14 10:57:56 +00:00
Serialization [ODRHash] Add diagnostic messages for typedef and type alias. 2017-06-12 21:58:22 +00:00
StaticAnalyzer [analyzer] Fix a crash when an ObjC object is constructed in AllocaRegion. 2017-06-12 17:59:50 +00:00
Tooling Method loadFromCommandLine should be able to report errors 2017-05-24 11:57:37 +00:00
CMakeLists.txt