mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use unique_ptr for Scope, getScope returns a reference
This commit is contained in:
@@ -1695,9 +1695,10 @@ StringRef SourceFile::getFilename() const {
|
||||
return SM.getIdentifierForBuffer(BufferID);
|
||||
}
|
||||
|
||||
ASTScope *SourceFile::getScope() {
|
||||
if (!Scope) Scope = ASTScope::createScopeTreeFor(this);
|
||||
return Scope;
|
||||
ASTScope &SourceFile::getScope() {
|
||||
if (!Scope)
|
||||
Scope = std::unique_ptr<ASTScope>(new (getASTContext()) ASTScope(this));
|
||||
return *Scope.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user