39 : allCooked_{allCooked}, features_{features} {}
44 llvm::raw_ostream *debugOutput()
const {
return debugOutput_; }
45 UserState &set_debugOutput(llvm::raw_ostream &out) {
56 bool instrumentedParse()
const {
return instrumentedParse_; }
57 UserState &set_instrumentedParse(
bool yes) {
58 instrumentedParse_ = yes;
62 void NewSubprogram() {
64 nonlabelDoConstructNestingDepth_ = 0;
65 oldStructureComponents_.clear();
68 using Label = std::uint64_t;
69 bool IsDoLabel(Label label)
const {
70 auto iter{doLabels_.find(label)};
71 return iter != doLabels_.end() &&
72 iter->second >= nonlabelDoConstructNestingDepth_;
74 void NewDoLabel(Label label) {
75 doLabels_[label] = nonlabelDoConstructNestingDepth_;
78 void EnterNonlabelDoConstruct() { ++nonlabelDoConstructNestingDepth_; }
79 void LeaveDoConstruct() {
80 if (nonlabelDoConstructNestingDepth_ > 0) {
81 --nonlabelDoConstructNestingDepth_;
85 void NoteOldStructureComponent(
const CharBlock &name) {
86 oldStructureComponents_.insert(name);
88 bool IsOldStructureComponent(
const CharBlock &name)
const {
89 return oldStructureComponents_.find(name) != oldStructureComponents_.end();
95 llvm::raw_ostream *debugOutput_{
nullptr};
98 bool instrumentedParse_{
false};
100 std::unordered_map<Label, int> doLabels_;
101 int nonlabelDoConstructNestingDepth_{0};
103 std::set<CharBlock> oldStructureComponents_;