summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Lex
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-19 15:59:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-19 15:59:08 +0000
commit1b07c344b4bcaacf2bc950a511283be0422c3fe8 (patch)
treef04ba612684753fee92b5d5e870ec7cbb27a63ef /clang/unittests/Lex
parentd169911cc02eca4ff335589ddc61ba9e8697816f (diff)
downloadbcm5719-llvm-1b07c344b4bcaacf2bc950a511283be0422c3fe8.tar.gz
bcm5719-llvm-1b07c344b4bcaacf2bc950a511283be0422c3fe8.zip
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. llvm-svn: 148479
Diffstat (limited to 'clang/unittests/Lex')
-rw-r--r--clang/unittests/Lex/LexerTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index 17c9cf8cca6..e63f31a705e 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud