aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-10-06 17:38:35 -0700
committerFangrui Song <i@maskray.me>2024-10-06 17:38:35 -0700
commitf2b01338584c90f48dba1a937bf5b1da8dcedbd5 (patch)
tree1651ff4e252a3ad96f017074d59a3ac36c2c2d2f /lld/ELF/ScriptParser.cpp
parent18ca7ad3393241b9fc0d5f149247e10837c6f926 (diff)
downloadllvm-f2b01338584c90f48dba1a937bf5b1da8dcedbd5.zip
llvm-f2b01338584c90f48dba1a937bf5b1da8dcedbd5.tar.gz
llvm-f2b01338584c90f48dba1a937bf5b1da8dcedbd5.tar.bz2
[ELF] Move static nextGroupId isInGroup to LinkerDriver
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index cc0e8ce..3febcfb 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -385,12 +385,10 @@ void ScriptParser::readExtern() {
}
void ScriptParser::readGroup() {
- bool orig = InputFile::isInGroup;
- InputFile::isInGroup = true;
+ SaveAndRestore saved(ctx.driver.isInGroup, true);
readInput();
- InputFile::isInGroup = orig;
- if (!orig)
- ++InputFile::nextGroupId;
+ if (!saved.get())
+ ++ctx.driver.nextGroupId;
}
void ScriptParser::readInclude() {