diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-20 14:26:54 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-20 14:26:54 +0000 | 
| commit | 9a199699c2fd227dae8c1ff60a70c819e9d4fdfe (patch) | |
| tree | 1953a1b292c4637ca2a5ede1494d3a5b84cccac3 /contrib/llvm/tools/clang/lib/Basic/Module.cpp | |
| parent | 2cab237b5dbfe1b3e9c7aa7a3c02d2b98fcf7462 (diff) | |
| parent | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Basic/Module.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Basic/Module.cpp | 30 | 
1 files changed, 23 insertions, 7 deletions
diff --git a/contrib/llvm/tools/clang/lib/Basic/Module.cpp b/contrib/llvm/tools/clang/lib/Basic/Module.cpp index 1d96afd476ef..7124184865c6 100644 --- a/contrib/llvm/tools/clang/lib/Basic/Module.cpp +++ b/contrib/llvm/tools/clang/lib/Basic/Module.cpp @@ -1,4 +1,4 @@ -//===--- Module.cpp - Describe a module -----------------------------------===// +//===- Module.cpp - Describe a module -------------------------------------===//  //  //                     The LLVM Compiler Infrastructure  // @@ -16,23 +16,33 @@  #include "clang/Basic/CharInfo.h"  #include "clang/Basic/FileManager.h"  #include "clang/Basic/LangOptions.h" +#include "clang/Basic/SourceLocation.h"  #include "clang/Basic/TargetInfo.h"  #include "llvm/ADT/ArrayRef.h"  #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h"  #include "llvm/ADT/StringSwitch.h" +#include "llvm/Support/Compiler.h"  #include "llvm/Support/ErrorHandling.h"  #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cassert> +#include <functional> +#include <string> +#include <utility> +#include <vector>  using namespace clang;  Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,                 bool IsFramework, bool IsExplicit, unsigned VisibilityID) -    : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Directory(), -      Umbrella(), ASTFile(nullptr), VisibilityID(VisibilityID), -      IsMissingRequirement(false), HasIncompatibleModuleFile(false), -      IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework), -      IsExplicit(IsExplicit), IsSystem(false), IsExternC(false), -      IsInferred(false), InferSubmodules(false), InferExplicitSubmodules(false), +    : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), +      VisibilityID(VisibilityID), 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),        NoUndeclaredIncludes(false), NameVisibility(Hidden) {    if (Parent) { @@ -130,6 +140,7 @@ static StringRef getModuleNameFromComponent(      const std::pair<std::string, SourceLocation> &IdComponent) {    return IdComponent.first;  } +  static StringRef getModuleNameFromComponent(StringRef R) { return R; }  template<typename InputIter> @@ -440,6 +451,11 @@ void Module::print(raw_ostream &OS, unsigned Indent) const {      }    } +  if (!ExportAsModule.empty()) { +    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  | 
