|
| 1 | +//===--- SILParserState.h - SILParserState declaration -------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +#ifndef SWIFT_SIL_SILPARSERSTATE_H |
| 14 | +#define SWIFT_SIL_SILPARSERSTATE_H |
| 15 | + |
| 16 | +#include "swift/Basic/LLVM.h" |
| 17 | +#include "swift/Parse/ParseSILSupport.h" |
| 18 | + |
| 19 | +//===----------------------------------------------------------------------===// |
| 20 | +// SILParserState |
| 21 | +//===----------------------------------------------------------------------===// |
| 22 | + |
| 23 | +namespace swift { |
| 24 | + |
| 25 | +class Parser; |
| 26 | +class SILModule; |
| 27 | + |
| 28 | +class SILParserState : public SILParserStateBase { |
| 29 | +public: |
| 30 | + explicit SILParserState(SILModule &M) : M(M) {} |
| 31 | + ~SILParserState(); |
| 32 | + |
| 33 | + SILModule &M; |
| 34 | + |
| 35 | + /// This is all of the forward referenced functions with |
| 36 | + /// the location for where the reference is. |
| 37 | + llvm::DenseMap<Identifier, Located<SILFunction *>> ForwardRefFns; |
| 38 | + /// A list of all functions forward-declared by a sil_scope. |
| 39 | + llvm::DenseSet<SILFunction *> PotentialZombieFns; |
| 40 | + |
| 41 | + /// A map from textual .sil scope number to SILDebugScopes. |
| 42 | + llvm::DenseMap<unsigned, SILDebugScope *> ScopeSlots; |
| 43 | + |
| 44 | + /// Did we parse a sil_stage for this module? |
| 45 | + bool DidParseSILStage = false; |
| 46 | + |
| 47 | + bool parseDeclSIL(Parser &P) override; |
| 48 | + bool parseDeclSILStage(Parser &P) override; |
| 49 | + bool parseSILVTable(Parser &P) override; |
| 50 | + bool parseSILGlobal(Parser &P) override; |
| 51 | + bool parseSILWitnessTable(Parser &P) override; |
| 52 | + bool parseSILDefaultWitnessTable(Parser &P) override; |
| 53 | + bool parseSILDifferentiabilityWitness(Parser &P) override; |
| 54 | + bool parseSILCoverageMap(Parser &P) override; |
| 55 | + bool parseSILProperty(Parser &P) override; |
| 56 | + bool parseSILScope(Parser &P) override; |
| 57 | +}; |
| 58 | + |
| 59 | +} // end namespace swift |
| 60 | + |
| 61 | +#endif // SWIFT_SIL_SILPARSERSTATE_H |
0 commit comments