ASTOOScope ontology

This commit is contained in:
David Ungar
2019-03-01 09:15:02 -08:00
parent 6171d68bfa
commit 663760e3b7
42 changed files with 5610 additions and 3610 deletions

View File

@@ -19,7 +19,6 @@
#include "swift/AST/ASTContext.h"
#include "swift/AST/ASTMangler.h"
#include "swift/AST/ASTPrinter.h"
#include "swift/AST/ASTScope.h"
#include "swift/AST/ASTWalker.h"
#include "swift/AST/Builtins.h"
#include "swift/AST/DiagnosticsSema.h"
@@ -1696,11 +1695,12 @@ StringRef SourceFile::getFilename() const {
return SM.getIdentifierForBuffer(BufferID);
}
ASTScope &SourceFile::getScope() {
if (!Scope) Scope = ASTScope::createRoot(this);
return *Scope;
ASTScope *SourceFile::getScope() {
if (!Scope) Scope = ASTScope::createScopeTreeFor(this);
return Scope;
}
Identifier
SourceFile::getDiscriminatorForPrivateValue(const ValueDecl *D) const {
assert(D->getDeclContext()->getModuleScopeContext() == this);