NetBSD re-synchronization of the source tree

This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
This commit is contained in:
2015-10-15 17:01:16 +02:00
parent 8933525b85
commit 0a6a1f1d05
32425 changed files with 2998623 additions and 1342348 deletions

View File

@@ -24,20 +24,23 @@
using namespace clang;
Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
bool IsFramework, bool IsExplicit)
: Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent),
Umbrella(), ASTFile(0), IsAvailable(true), IsFromModuleFile(false),
IsFramework(IsFramework), IsExplicit(IsExplicit), IsSystem(false),
InferSubmodules(false), InferExplicitSubmodules(false),
InferExportWildcard(false), ConfigMacrosExhaustive(false),
NameVisibility(Hidden)
{
: Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Directory(),
Umbrella(), ASTFile(nullptr), 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) {
if (Parent) {
if (!Parent->isAvailable())
IsAvailable = false;
if (Parent->IsSystem)
IsSystem = true;
if (Parent->IsExternC)
IsExternC = true;
IsMissingRequirement = Parent->IsMissingRequirement;
Parent->SubModuleIndex[Name] = Parent->SubModules.size();
Parent->SubModules.push_back(this);
@@ -67,13 +70,17 @@ static bool hasFeature(StringRef Feature, const LangOptions &LangOpts,
.Default(Target.hasFeature(Feature));
}
bool
Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
Requirement &Req) const {
bool Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
Requirement &Req,
UnresolvedHeaderDirective &MissingHeader) const {
if (IsAvailable)
return true;
for (const Module *Current = this; Current; Current = Current->Parent) {
if (!Current->MissingHeaders.empty()) {
MissingHeader = Current->MissingHeaders.front();
return false;
}
for (unsigned I = 0, N = Current->Requirements.size(); I != N; ++I) {
if (hasFeature(Current->Requirements[I].first, LangOpts, Target) !=
Current->Requirements[I].second) {
@@ -86,7 +93,7 @@ Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
llvm_unreachable("could not find a reason why module is unavailable");
}
bool Module::isSubModuleOf(Module *Other) const {
bool Module::isSubModuleOf(const Module *Other) const {
const Module *This = this;
do {
if (This == Other)
@@ -155,6 +162,10 @@ void Module::addRequirement(StringRef Feature, bool RequiredState,
if (hasFeature(Feature, LangOpts, Target) == RequiredState)
return;
markUnavailable(/*MissingRequirement*/true);
}
void Module::markUnavailable(bool MissingRequirement) {
if (!IsAvailable)
return;
@@ -168,6 +179,7 @@ void Module::addRequirement(StringRef Feature, bool RequiredState,
continue;
Current->IsAvailable = false;
Current->IsMissingRequirement |= MissingRequirement;
for (submodule_iterator Sub = Current->submodule_begin(),
SubEnd = Current->submodule_end();
Sub != SubEnd; ++Sub) {
@@ -180,8 +192,8 @@ void Module::addRequirement(StringRef Feature, bool RequiredState,
Module *Module::findSubmodule(StringRef Name) const {
llvm::StringMap<unsigned>::const_iterator Pos = SubModuleIndex.find(Name);
if (Pos == SubModuleIndex.end())
return 0;
return nullptr;
return SubModules[Pos->getValue()];
}
@@ -281,9 +293,12 @@ void Module::print(raw_ostream &OS, unsigned Indent) const {
OS << "explicit ";
OS << "module " << Name;
if (IsSystem) {
if (IsSystem || IsExternC) {
OS.indent(Indent + 2);
OS << " [system]";
if (IsSystem)
OS << " [system]";
if (IsExternC)
OS << " [extern_c]";
}
OS << " {\n";
@@ -326,30 +341,32 @@ void Module::print(raw_ostream &OS, unsigned Indent) const {
OS << "\n";
}
for (unsigned I = 0, N = NormalHeaders.size(); I != N; ++I) {
OS.indent(Indent + 2);
OS << "header \"";
OS.write_escaped(NormalHeaders[I]->getName());
OS << "\"\n";
struct {
StringRef Prefix;
HeaderKind Kind;
} Kinds[] = {{"", HK_Normal},
{"textual ", HK_Textual},
{"private ", HK_Private},
{"private textual ", HK_PrivateTextual},
{"exclude ", HK_Excluded}};
for (auto &K : Kinds) {
for (auto &H : Headers[K.Kind]) {
OS.indent(Indent + 2);
OS << K.Prefix << "header \"";
OS.write_escaped(H.NameAsWritten);
OS << "\"\n";
}
}
for (unsigned I = 0, N = ExcludedHeaders.size(); I != N; ++I) {
OS.indent(Indent + 2);
OS << "exclude header \"";
OS.write_escaped(ExcludedHeaders[I]->getName());
OS << "\"\n";
}
for (unsigned I = 0, N = PrivateHeaders.size(); I != N; ++I) {
OS.indent(Indent + 2);
OS << "private header \"";
OS.write_escaped(PrivateHeaders[I]->getName());
OS << "\"\n";
}
for (submodule_const_iterator MI = submodule_begin(), MIEnd = submodule_end();
MI != MIEnd; ++MI)
(*MI)->print(OS, Indent + 2);
// Print inferred subframework modules so that we don't need to re-infer
// them (requires expensive directory iteration + stat calls) when we build
// the module. Regular inferred submodules are OK, as we need to look at all
// 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);