diff options
author | Faisal Vali <faisalv@yahoo.com> | 2017-07-17 01:27:53 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2017-07-17 01:27:53 +0000 |
commit | 11746b05e576ca2a1f21b61721d0a13975ace751 (patch) | |
tree | 220890d29d31f5dda7c5d36fb745c114673760e2 /clang/unittests/Lex/LexerTest.cpp | |
parent | 9466a84a4ef38b4c8348c5f3b4b5c639faa1d576 (diff) | |
download | llvm-11746b05e576ca2a1f21b61721d0a13975ace751.zip llvm-11746b05e576ca2a1f21b61721d0a13975ace751.tar.gz llvm-11746b05e576ca2a1f21b61721d0a13975ace751.tar.bz2 |
[NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions.
- Extracted the reading of the tokens out into a separate function.
- Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation).
This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible.
Thanks!
llvm-svn: 308157
Diffstat (limited to 'clang/unittests/Lex/LexerTest.cpp')
-rw-r--r-- | clang/unittests/Lex/LexerTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp index a887c22..923aff1 100644 --- a/clang/unittests/Lex/LexerTest.cpp +++ b/clang/unittests/Lex/LexerTest.cpp @@ -379,11 +379,11 @@ TEST_F(LexerTest, DontOverallocateStringifyArgs) { auto PP = CreatePP("\"StrArg\", 5, 'C'", ModLoader); llvm::BumpPtrAllocator Allocator; - std::array<IdentifierInfo *, 3> ArgList; + std::array<IdentifierInfo *, 3> ParamList; MacroInfo *MI = PP->AllocateMacroInfo({}); MI->setIsFunctionLike(); - MI->setArgumentList(ArgList, Allocator); - EXPECT_EQ(3u, MI->getNumArgs()); + MI->setParameterList(ParamList, Allocator); + EXPECT_EQ(3u, MI->getNumParams()); EXPECT_TRUE(MI->isFunctionLike()); Token Eof; |