mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] Specialize the source locations for ReturnLocation and ImplicitReturnLocation.
Swift SVN r7913
This commit is contained in:
@@ -31,6 +31,16 @@ SourceLoc SILLocation::getSourceLoc() const {
|
||||
return getEndSourceLoc();
|
||||
}
|
||||
|
||||
// Use the end location for the ImplicitReturnKind.
|
||||
if (getKind() == ImplicitReturnKind) {
|
||||
return getEndSourceLoc();
|
||||
}
|
||||
|
||||
// Use the start location for the ReturnKind.
|
||||
if (getKind() == ReturnKind) {
|
||||
return getStartSourceLoc();
|
||||
}
|
||||
|
||||
if (auto decl = ASTNode.dyn_cast<Decl*>())
|
||||
return decl->getLoc();
|
||||
if (auto expr = ASTNode.dyn_cast<Expr*>())
|
||||
|
||||
Reference in New Issue
Block a user