[AST] Use cached deserialized decl in getOpaqueResultTypeDecl

Mangling and looking up the opaque result type decl
for serialized decls is a fairly expensive
operation. Instead, fallthrough to the request
which will have a cached value set by deserialization.
This shaves ~30ms off the cached completion for:

```swift
import SwiftUI

struct V: View {
  var body: some View {
    Table(#^CC^#
  }
}
```
This commit is contained in:
Hamish Knight
2024-11-04 11:29:55 +00:00
parent 43839ac5fd
commit 152812cc86
7 changed files with 69 additions and 46 deletions

View File

@@ -2758,6 +2758,10 @@ private:
/// output a null pointer.
unsigned noDynamicallyReplacedDecl : 1;
/// Whether the OpaqueResultTypeRequest request was evaluated and produced
/// a null pointer.
unsigned noOpaqueResultType : 1;
/// Whether the "isFinal" bit has been computed yet.
unsigned isFinalComputed : 1;
@@ -2785,7 +2789,7 @@ private:
friend class InterfaceTypeRequest;
friend class CheckRedeclarationRequest;
friend class ActorIsolationRequest;
friend class DynamicallyReplacedDeclRequest;
friend class OpaqueResultTypeRequest;
friend class ApplyAccessNoteRequest;
friend class Decl;