[CursorInfo] Add a synthesized field

Mark implicit declarations with a `synthesized` field, since while we
still want them to have a cursor info result (eg. for their USR to find
possible overrides), it's likely that clients will want to treat them
differently to results that have a real location in source.

An alternative could be to remove the location entirely, but:
  - the module name would also have to be removed to prevent wasted
    lookups in the generated interface
  - having the location could still be useful as the location that
    caused the synthesized declaration (though at the moment only
    synthesized initializers have a location)

Resolves rdar://84990655
This commit is contained in:
Ben Barham
2021-11-05 15:40:21 +10:00
parent 4592132f0b
commit fd7d59daa6
6 changed files with 44 additions and 0 deletions

View File

@@ -1114,6 +1114,8 @@ fillSymbolInfo(CursorSymbolInfo &Symbol, const DeclInfo &DInfo,
Symbol.IsSystem = DInfo.VD->getModuleContext()->isSystemModule();
Symbol.IsDynamic = DInfo.IsDynamic;
Symbol.IsSynthesized = DInfo.VD->isImplicit();
Symbol.ParentNameOffset = getParamParentNameOffset(DInfo.VD, CursorLoc);
return llvm::Error::success();