================
@@ -1101,6 +1110,28 @@ void UnwrappedLineParser::conditionalCompilationEnd() {
     PPStack.pop_back();
 }
 
+UnwrappedLineParser::PPState UnwrappedLineParser::savePPState() const {
+  return {PPStack,
+          PPBranchLevel,
+          PPLevelBranchIndex,
+          PPLevelBranchCount,
+          PPChainBranchIndex,
+          IncludeGuard,
+          IncludeGuardToken,
+          AtEndOfPPLine};
+}
+
+void UnwrappedLineParser::restorePPState(const PPState &State) {
+  PPStack = State.PPStack;
+  PPBranchLevel = State.PPBranchLevel;
+  PPLevelBranchIndex = State.PPLevelBranchIndex;
+  PPLevelBranchCount = State.PPLevelBranchCount;
+  PPChainBranchIndex = State.PPChainBranchIndex;
+  IncludeGuard = State.IncludeGuard;
+  IncludeGuardToken = State.IncludeGuardToken;
+  AtEndOfPPLine = State.AtEndOfPPLine;
+}
+
----------------
and2049 wrote:

I think so as well, I'll revise the patch to use a single PPState member in the 
parser instead of saving and restoring each member individually. 

https://github.com/llvm/llvm-project/pull/221501
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to