aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2025-07-07 16:41:36 +0200
committerHaojian Wu <hokein.wu@gmail.com>2025-07-07 16:43:46 +0200
commit7c2182a132c709316f7795197978a610a9dfdeae (patch)
treeafbc6f166c40639d96d00c88e87191d1fadcb8a0 /clang/lib/Basic/SourceManager.cpp
parent543f94831245497b675dadb6a20ebc309d289465 (diff)
downloadllvm-7c2182a132c709316f7795197978a610a9dfdeae.zip
llvm-7c2182a132c709316f7795197978a610a9dfdeae.tar.gz
llvm-7c2182a132c709316f7795197978a610a9dfdeae.tar.bz2
NFC, use structured binding to simplify the code in SourceManager.cpp.
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 8ee2202..b2b1488 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -1795,9 +1795,8 @@ void SourceManager::associateFileChunkWithMacroArgExp(
// spelling range and if one is itself a macro argument expansion, recurse
// and associate the file chunk that it represents.
- FileID SpellFID; // Current FileID in the spelling range.
- unsigned SpellRelativeOffs;
- std::tie(SpellFID, SpellRelativeOffs) = getDecomposedLoc(SpellLoc);
+ // Current FileID in the spelling range.
+ auto [SpellFID, SpellRelativeOffs] = getDecomposedLoc(SpellLoc);
while (true) {
const SLocEntry &Entry = getSLocEntry(SpellFID);
SourceLocation::UIntTy SpellFIDBeginOffs = Entry.getOffset();
@@ -1879,9 +1878,7 @@ SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
if (Loc.isInvalid() || !Loc.isFileID())
return Loc;
- FileID FID;
- unsigned Offset;
- std::tie(FID, Offset) = getDecomposedLoc(Loc);
+ auto [FID, Offset] = getDecomposedLoc(Loc);
if (FID.isInvalid())
return Loc;