[Serialization] Preserve submodule import paths through serialization.

This is a bit of a hack, but Clang submodules are the only case we have to
support.

Part of <rdar://problem/13140302>

Swift SVN r20287
This commit is contained in:
Jordan Rose
2014-07-22 01:31:15 +00:00
parent d82edd9608
commit 6ee53ff75f
7 changed files with 87 additions and 33 deletions

View File

@@ -81,16 +81,18 @@ public:
private:
const unsigned IsExported : 1;
const unsigned IsHeader : 1;
const unsigned IsScoped : 1;
Dependency(StringRef path, bool exported, bool isHeader)
: RawPath(path), IsExported(exported), IsHeader(isHeader){}
Dependency(StringRef path, bool isHeader, bool exported, bool isScoped)
: RawPath(path), IsExported(exported), IsHeader(isHeader),
IsScoped(isScoped) {}
public:
Dependency(StringRef path, bool exported)
: Dependency(path, exported, false) {}
Dependency(StringRef path, bool exported, bool isScoped)
: Dependency(path, false, exported, isScoped) {}
static Dependency forHeader(StringRef headerPath, bool exported) {
return Dependency(headerPath, exported, true);
return Dependency(headerPath, true, exported, false);
}
bool isLoaded() const {
@@ -99,6 +101,9 @@ public:
bool isExported() const { return IsExported; }
bool isHeader() const { return IsHeader; }
bool isScoped() const { return IsScoped; }
std::string getPrettyPrintedPath() const;
};
private:
@@ -505,7 +510,7 @@ public:
///
/// If the name matches the name of the current module, a shadowed module
/// is loaded instead.
Module *getModule(Identifier name);
Module *getModule(ArrayRef<Identifier> name);
/// Reads a substitution record from \c DeclTypeCursor.
///