38 : allCooked_{allCooked}, features_{features} {}
43 llvm::raw_ostream *debugOutput()
const {
return debugOutput_; }
44 UserState &set_debugOutput(llvm::raw_ostream &out) {
55 bool instrumentedParse()
const {
return instrumentedParse_; }
56 UserState &set_instrumentedParse(
bool yes) {
57 instrumentedParse_ = yes;
61 void NewSubprogram() {
63 nonlabelDoConstructNestingDepth_ = 0;
64 oldStructureComponents_.clear();
67 using Label = std::uint64_t;
68 bool IsDoLabel(Label label)
const {
69 auto iter{doLabels_.find(label)};
70 return iter != doLabels_.end() &&
71 iter->second >= nonlabelDoConstructNestingDepth_;
73 void NewDoLabel(Label label) {
74 doLabels_[label] = nonlabelDoConstructNestingDepth_;
77 void EnterNonlabelDoConstruct() { ++nonlabelDoConstructNestingDepth_; }
78 void LeaveDoConstruct() {
79 if (nonlabelDoConstructNestingDepth_ > 0) {
80 --nonlabelDoConstructNestingDepth_;
84 void NoteOldStructureComponent(
const CharBlock &name) {
85 oldStructureComponents_.insert(name);
87 bool IsOldStructureComponent(
const CharBlock &name)
const {
88 return oldStructureComponents_.find(name) != oldStructureComponents_.end();
94 llvm::raw_ostream *debugOutput_{
nullptr};
97 bool instrumentedParse_{
false};
99 std::unordered_map<Label, int> doLabels_;
100 int nonlabelDoConstructNestingDepth_{0};
102 std::set<CharBlock> oldStructureComponents_;