Introduce infrastructure for maintaining per-translation unit SIL parser state across

invocations of the parser.



Swift SVN r5906
This commit is contained in:
Chris Lattner
2013-06-30 18:44:59 +00:00
parent e64e30542d
commit 20229fbf85
5 changed files with 50 additions and 12 deletions

View File

@@ -34,10 +34,23 @@ namespace swift {
class SILModule;
class LangOptions;
struct TypeLoc;
class SILParserTUState;
namespace irgen {
class Options;
}
/// SILParserState - This is a context object used to optionally maintain SIL
/// parsing context for the parser.
class SILParserState {
public:
SILModule *M;
SILParserTUState *S;
explicit SILParserState(SILModule *M);
~SILParserState();
};
/// verify - Check that the translation unit is well formed (i.e. following
/// the invariants of the AST, not that the code written by the user makes
@@ -52,7 +65,7 @@ namespace swift {
bool parseIntoTranslationUnit(TranslationUnit *TU, unsigned BufferID,
unsigned *BufferOffset = 0,
unsigned BufferEndOffset = 0,
SILModule *SIL = 0);
SILParserState *SIL = 0);
/// Attempt to parse a StringRef as a code completion context expression.
/// Returns the parsed expression if successful, or null if an expression