diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:59:51 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:59:51 +0000 | 
| commit | 7cb19e8bd99e7a7f926ad363aa2b4dd58fb8e380 (patch) | |
| tree | 8d5195e81c160c2a7c7d93674e053a67d0f31092 /contrib/llvm/tools/clang/lib/Basic/Module.cpp | |
| parent | 1c4688a8498fea1db507842ff8dedaacad8ef77b (diff) | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic/Module.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Basic/Module.cpp | 28 | 
1 files changed, 14 insertions, 14 deletions
| diff --git a/contrib/llvm/tools/clang/lib/Basic/Module.cpp b/contrib/llvm/tools/clang/lib/Basic/Module.cpp index 2714b98120c0..1a0c19059058 100644 --- a/contrib/llvm/tools/clang/lib/Basic/Module.cpp +++ b/contrib/llvm/tools/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";  } | 
