From 69bda4c027671df7163619f215209529eb236620 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 19 Jan 2012 15:59:08 +0000 Subject: For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macro start/end location. It is commonly needed after calling the function; with this way we avoid recalculating it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148479 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Lex/LexerTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'unittests/Lex') diff --git a/unittests/Lex/LexerTest.cpp b/unittests/Lex/LexerTest.cpp index 17c9cf8cca..e63f31a705 100644 --- a/unittests/Lex/LexerTest.cpp +++ b/unittests/Lex/LexerTest.cpp @@ -91,10 +91,13 @@ TEST_F(LexerTest, LexAPI) { SourceLocation idLoc = toks[1].getLocation(); SourceLocation rsqrLoc = toks[2].getLocation(); - EXPECT_TRUE(Lexer::isAtStartOfMacroExpansion(lsqrLoc, SourceMgr, LangOpts)); + SourceLocation Loc; + EXPECT_TRUE(Lexer::isAtStartOfMacroExpansion(lsqrLoc, SourceMgr, LangOpts, &Loc)); + EXPECT_EQ(SourceMgr.getExpansionLoc(lsqrLoc), Loc); EXPECT_FALSE(Lexer::isAtStartOfMacroExpansion(idLoc, SourceMgr, LangOpts)); EXPECT_FALSE(Lexer::isAtEndOfMacroExpansion(idLoc, SourceMgr, LangOpts)); - EXPECT_TRUE(Lexer::isAtEndOfMacroExpansion(rsqrLoc, SourceMgr, LangOpts)); + EXPECT_TRUE(Lexer::isAtEndOfMacroExpansion(rsqrLoc, SourceMgr, LangOpts, &Loc)); + EXPECT_EQ(SourceMgr.getExpansionRange(rsqrLoc).second, Loc); } } // anonymous namespace -- cgit v1.2.3