@@ -1029,6 +1029,37 @@ class ASTReader
10291029 llvm::SmallVector<PragmaAlignPackStackEntry, 2 > PragmaAlignPackStack;
10301030 llvm::SmallVector<std::string, 2 > PragmaAlignPackStrings;
10311031
1032+ // The pragma init_seg() state.
1033+ std::string CurInitSeg = " " ;
1034+ SourceLocation CurInitSegLoc;
1035+
1036+ // The section info state
1037+ struct SectionInfo {
1038+ std::string SectionName;
1039+ SourceLocation PragmaSectionLocation;
1040+ int SectionFlags;
1041+ };
1042+ llvm::SmallVector<SectionInfo, 2 > SectionInfos;
1043+
1044+ struct PragmaSegmentStackEntry {
1045+ std::string Value;
1046+ SourceLocation Location;
1047+ SourceLocation PushLocation;
1048+ StringRef SlotLabel;
1049+ };
1050+
1051+ struct PragmaSegmentStackState {
1052+ std::optional<std::string> PragmaCurrentValue;
1053+ SourceLocation PragmaCurrentLocation;
1054+ llvm::SmallVector<PragmaSegmentStackEntry, 2 > PragmaStack;
1055+ llvm::SmallVector<std::string, 2 > PragmaStrings;
1056+ };
1057+
1058+ PragmaSegmentStackState PragmaDataSegmentStackState;
1059+ PragmaSegmentStackState PragmaBSSSegmentStackState;
1060+ PragmaSegmentStackState PragmaConstSegmentStackState;
1061+ PragmaSegmentStackState PragmaCodeSegmentStackState;
1062+
10321063 // / The OpenCL extension settings.
10331064 OpenCLOptions OpenCLExtensions;
10341065
@@ -1942,6 +1973,8 @@ class ASTReader
19421973 // / Initializes the ASTContext
19431974 void InitializeContext ();
19441975
1976+ void UpdateSemaPragmaSegment (PragmaSegmentStackState &StackState, Sema::PragmaStack<std::string> &PragmaStack);
1977+
19451978 // / Update the state of Sema after loading some additional modules.
19461979 void UpdateSema ();
19471980
0 commit comments