diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 13:34:49 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 13:34:49 +0000 | 
| commit | 0623d7483df5fc17b32ba7bc5cb9c7beebf6db9c (patch) | |
| tree | 28726ef2038e86121e353aabf52297b35a48efa2 /contrib/llvm/tools/clang/lib/Basic/Module.cpp | |
| parent | 7d523365ff1a3cc95bc058b33102500f61e8166d (diff) | |
| parent | 45b533945f0851ec234ca846e1af5ee1e4df0b6e (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic/Module.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Basic/Module.cpp | 20 | 
1 files changed, 15 insertions, 5 deletions
| diff --git a/contrib/llvm/tools/clang/lib/Basic/Module.cpp b/contrib/llvm/tools/clang/lib/Basic/Module.cpp index 4314b41eb340..0b7832636943 100644 --- a/contrib/llvm/tools/clang/lib/Basic/Module.cpp +++ b/contrib/llvm/tools/clang/lib/Basic/Module.cpp @@ -28,11 +28,12 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,                 bool IsFramework, bool IsExplicit, unsigned VisibilityID)      : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Directory(),        Umbrella(), Signature(0), ASTFile(nullptr), VisibilityID(VisibilityID), -      IsMissingRequirement(false), IsAvailable(true), IsFromModuleFile(false), -      IsFramework(IsFramework), IsExplicit(IsExplicit), IsSystem(false), -      IsExternC(false), IsInferred(false), InferSubmodules(false), -      InferExplicitSubmodules(false), InferExportWildcard(false), -      ConfigMacrosExhaustive(false), NameVisibility(Hidden) { +      IsMissingRequirement(false), HasIncompatibleModuleFile(false), +      IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework), +      IsExplicit(IsExplicit), IsSystem(false), IsExternC(false), +      IsInferred(false), InferSubmodules(false), InferExplicitSubmodules(false), +      InferExportWildcard(false), ConfigMacrosExhaustive(false), +      NameVisibility(Hidden) {    if (Parent) {      if (!Parent->isAvailable())        IsAvailable = false; @@ -139,6 +140,15 @@ std::string Module::getFullModuleName() const {    return Result;  } +bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const { +  for (const Module *M = this; M; M = M->Parent) { +    if (nameParts.empty() || M->Name != nameParts.back()) +      return false; +    nameParts = nameParts.drop_back(); +  } +  return nameParts.empty(); +} +  Module::DirectoryName Module::getUmbrellaDir() const {    if (Header U = getUmbrellaHeader())      return {"", U.Entry->getDir()}; | 
