mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Don't drop const qualifiers.
This commit is contained in:
@@ -346,7 +346,7 @@ static bool initDocEntityInfo(const Decl *D, const Decl *SynthesizedTarget,
|
||||
|
||||
if (DefaultImplementationOf) {
|
||||
llvm::raw_svector_ostream OS(Info.ProvideImplementationOfUSR);
|
||||
SwiftLangSupport::printUSR((ValueDecl*)DefaultImplementationOf, OS);
|
||||
SwiftLangSupport::printUSR((const ValueDecl*)DefaultImplementationOf, OS);
|
||||
}
|
||||
|
||||
Info.IsUnavailable = AvailableAttr::isUnavailable(D);
|
||||
@@ -369,13 +369,13 @@ static bool initDocEntityInfo(const Decl *D, const Decl *SynthesizedTarget,
|
||||
assert(DocRef.find(Open) != StringRef::npos);
|
||||
auto FirstPart = DocRef.substr(0, DocRef.find(Open) + (Open).size());
|
||||
auto SecondPart = DocRef.substr(FirstPart.size());
|
||||
auto ExtendedName = ((ExtensionDecl*)D)->getExtendedType()->
|
||||
auto ExtendedName = ((const ExtensionDecl*)D)->getExtendedType()->
|
||||
getAnyNominal()->getName().str();
|
||||
assert(SecondPart.startswith(ExtendedName));
|
||||
SecondPart = SecondPart.substr(ExtendedName.size());
|
||||
llvm::SmallString<128> UpdatedDocBuffer;
|
||||
UpdatedDocBuffer.append(FirstPart);
|
||||
UpdatedDocBuffer.append(((NominalTypeDecl*)SynthesizedTarget)->getName().
|
||||
UpdatedDocBuffer.append(((const NominalTypeDecl*)SynthesizedTarget)->getName().
|
||||
str());
|
||||
UpdatedDocBuffer.append(SecondPart);
|
||||
OS << UpdatedDocBuffer;
|
||||
@@ -522,7 +522,7 @@ static void reportRelated(ASTContext &Ctx,
|
||||
return;
|
||||
if (const auto *ED = dyn_cast<ExtensionDecl>(D)) {
|
||||
if (SynthesizedTarget) {
|
||||
passExtends((ValueDecl*)SynthesizedTarget, Consumer);
|
||||
passExtends((const ValueDecl*)SynthesizedTarget, Consumer);
|
||||
} else if (Type T = ED->getExtendedType()) {
|
||||
if (auto TD = getTypeDeclFromType(T))
|
||||
passExtends(TD, Consumer);
|
||||
|
||||
Reference in New Issue
Block a user