mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: refactor the ABI/API diagnostics to use DiagnosticEngine. NFC (#18957)
Before this patch, we used to define tooling-specific diagnostics. With adding more checking logics, we found this mechanism hard to extend. This patch eliminates the home-made diagnostics model to use the one from compiler, which provides several benefits: less boiler-templates, better integration with DiagnosticConsumer, and easy ordering of detected issues.
This commit is contained in:
@@ -293,6 +293,22 @@ SDKNode *SDKNodeRoot::getInstance(SDKContext &Ctx) {
|
||||
return Info.createSDKNode(SDKNodeKind::Root);
|
||||
}
|
||||
|
||||
StringRef SDKNodeDecl::getScreenInfo() const {
|
||||
auto ModuleName = getModuleName();
|
||||
auto HeaderName = getHeaderName();
|
||||
auto &Ctx = getSDKContext();
|
||||
llvm::SmallString<64> SS;
|
||||
llvm::raw_svector_ostream OS(SS);
|
||||
if (Ctx.getOpts().PrintModule)
|
||||
OS << ModuleName;
|
||||
if (!HeaderName.empty())
|
||||
OS << "(" << HeaderName << ")";
|
||||
if (!OS.str().empty())
|
||||
OS << ": ";
|
||||
OS << getDeclKind() << " " << getFullyQualifiedName();
|
||||
return Ctx.buffer(OS.str());
|
||||
}
|
||||
|
||||
bool SDKNodeDecl::isSDKPrivate() const {
|
||||
if (getName().startswith("__"))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user