diff options
author | Haojian Wu <hokein.wu@gmail.com> | 2025-06-26 14:12:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-26 14:12:51 +0200 |
commit | 0b6ddb02efdcbdac9426e8d857499ea0580303cd (patch) | |
tree | eed7f54265dca87249adc7155112d50ded8c540d /clang/unittests/Lex/LexerTest.cpp | |
parent | 548e8e92e98d727534aff93771e032696aca11e3 (diff) | |
download | llvm-0b6ddb02efdcbdac9426e8d857499ea0580303cd.zip llvm-0b6ddb02efdcbdac9426e8d857499ea0580303cd.tar.gz llvm-0b6ddb02efdcbdac9426e8d857499ea0580303cd.tar.bz2 |
[clang] NFC: Add alias for std::pair<FileID, unsigned> used in SourceLocation (#145711)
Introduce a type alias for the commonly used `std::pair<FileID,
unsigned>` to improve code readability, and make it easier for future
updates (64-bit source locations).
Diffstat (limited to 'clang/unittests/Lex/LexerTest.cpp')
-rw-r--r-- | clang/unittests/Lex/LexerTest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp index 2adb554..86df872 100644 --- a/clang/unittests/Lex/LexerTest.cpp +++ b/clang/unittests/Lex/LexerTest.cpp @@ -522,15 +522,14 @@ TEST_F(LexerTest, GetBeginningOfTokenWithEscapedNewLine) { std::vector<Token> LexedTokens = CheckLex(TextToLex, ExpectedTokens); for (const Token &Tok : LexedTokens) { - std::pair<FileID, unsigned> OriginalLocation = + FileIDAndOffset OriginalLocation = SourceMgr.getDecomposedLoc(Tok.getLocation()); for (unsigned Offset = 0; Offset < IdentifierLength; ++Offset) { SourceLocation LookupLocation = Tok.getLocation().getLocWithOffset(Offset); - std::pair<FileID, unsigned> FoundLocation = - SourceMgr.getDecomposedExpansionLoc( - Lexer::GetBeginningOfToken(LookupLocation, SourceMgr, LangOpts)); + FileIDAndOffset FoundLocation = SourceMgr.getDecomposedExpansionLoc( + Lexer::GetBeginningOfToken(LookupLocation, SourceMgr, LangOpts)); // Check that location returned by the GetBeginningOfToken // is the same as original token location reported by Lexer. |