swift-api-digester: mark if a type declaration is pulled from an external module

To incorporate extensions to types from other modules, the tool sometimes needs
to pull type declaration from external modules even though these modules
are not under checking. We need a flag to explicitly mark such case.
This commit is contained in:
Xi Ge
2019-05-24 16:02:38 -07:00
parent 6e0d771747
commit 92719d6f30
5 changed files with 12 additions and 2 deletions

View File

@@ -469,6 +469,9 @@ class SDKNodeDeclType: public SDKNodeDecl {
std::vector<StringRef> SuperclassNames;
std::vector<SDKNode*> Conformances;
StringRef EnumRawTypeName;
// Check whether the type declaration is pulled from an external module so we
// can incorporate extensions in the interested module.
bool IsExternal;
public:
SDKNodeDeclType(SDKNodeInitInfo Info);
static bool classof(const SDKNode *N);
@@ -477,6 +480,7 @@ public:
void addConformance(SDKNode *Conf);
ArrayRef<SDKNode*> getConformances() const { return Conformances; }
NodeVector getConformances() { return Conformances; }
bool isExternal() const { return IsExternal; }
StringRef getSuperClassName() const {
return SuperclassNames.empty() ? StringRef() : SuperclassNames.front();
};