diff options
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 2714b98120c..1a0c1905905 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -58,7 +58,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, if (Parent->ModuleMapIsPrivate) ModuleMapIsPrivate = true; IsMissingRequirement = Parent->IsMissingRequirement; - + Parent->SubModuleIndex[Name] = Parent->SubModules.size(); Parent->SubModules.push_back(this); } @@ -134,10 +134,10 @@ bool Module::isSubModuleOf(const Module *Other) const { do { if (This == Other) return true; - + This = This->Parent; } while (This); - + return false; } @@ -145,7 +145,7 @@ const Module *Module::getTopLevelModule() const { const Module *Result = this; while (Result->Parent) Result = Result->Parent; - + return Result; } @@ -181,16 +181,16 @@ static void printModuleId(raw_ostream &OS, const Container &C) { std::string Module::getFullModuleName(bool AllowStringLiterals) const { SmallVector<StringRef, 2> Names; - + // Build up the set of module names (from innermost to outermost). for (const Module *M = this; M; M = M->Parent) Names.push_back(M->Name); - + std::string Result; llvm::raw_string_ostream Out(Result); printModuleId(Out, Names.rbegin(), Names.rend(), AllowStringLiterals); - Out.flush(); + Out.flush(); return Result; } @@ -207,7 +207,7 @@ bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const { Module::DirectoryName Module::getUmbrellaDir() const { if (Header U = getUmbrellaHeader()) return {"", U.Entry->getDir()}; - + return {UmbrellaAsWritten, Umbrella.dyn_cast<const DirectoryEntry *>()}; } @@ -388,7 +388,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { } OS << " {\n"; - + if (!Requirements.empty()) { OS.indent(Indent + 2); OS << "requires "; @@ -401,7 +401,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { } OS << "\n"; } - + if (Header H = getUmbrellaHeader()) { OS.indent(Indent + 2); OS << "umbrella header \""; @@ -411,7 +411,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "umbrella \""; OS.write_escaped(D.NameAsWritten); - OS << "\"\n"; + OS << "\"\n"; } if (!ConfigMacros.empty() || ConfigMacrosExhaustive) { @@ -468,7 +468,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "export_as" << ExportAsModule << "\n"; } - + for (submodule_const_iterator MI = submodule_begin(), MIEnd = submodule_end(); MI != MIEnd; ++MI) // Print inferred subframework modules so that we don't need to re-infer @@ -477,7 +477,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { // those header files anyway. if (!(*MI)->IsInferred || (*MI)->IsFramework) (*MI)->print(OS, Indent + 2); - + for (unsigned I = 0, N = Exports.size(); I != N; ++I) { OS.indent(Indent + 2); OS << "export "; @@ -554,7 +554,7 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent + 2); OS << "}\n"; } - + OS.indent(Indent); OS << "}\n"; } |