Make sure that Module::ConfigMacrosExhaustive gets initialized and deserialized correctly.

This fixes regressions introduced in r177466 that caused several
module tests to fail sporadically.

llvm-svn: 177481
This commit is contained in:
Douglas Gregor 2013-03-20 03:59:18 +00:00
parent 22c7c4131a
commit 8d93242709
2 changed files with 10 additions and 6 deletions

View File

@ -28,7 +28,8 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
Umbrella(), ASTFile(0), IsAvailable(true), IsFromModuleFile(false),
IsFramework(IsFramework), IsExplicit(IsExplicit), IsSystem(false),
InferSubmodules(false), InferExplicitSubmodules(false),
InferExportWildcard(false), NameVisibility(Hidden)
InferExportWildcard(false), ConfigMacrosExhaustive(false),
NameVisibility(Hidden)
{
if (Parent) {
if (!Parent->isAvailable())
@ -46,7 +47,6 @@ Module::~Module() {
I != IEnd; ++I) {
delete *I;
}
}
/// \brief Determine whether a translation unit built using the current
@ -284,12 +284,13 @@ void Module::print(raw_ostream &OS, unsigned Indent) const {
OS.indent(Indent + 2);
OS << "config_macros ";
if (ConfigMacrosExhaustive)
OS << "[exhausive]";
OS << "[exhaustive]";
for (unsigned I = 0, N = ConfigMacros.size(); I != N; ++I) {
if (I)
OS << ", ";
OS << ConfigMacros[I];
}
OS << "\n";
}
for (unsigned I = 0, N = Headers.size(); I != N; ++I) {

View File

@ -3475,7 +3475,7 @@ bool ASTReader::ReadSubmoduleBlock(ModuleFile &F) {
return true;
}
if (Record.size() < 7) {
if (Record.size() < 8) {
Error("malformed module definition");
return true;
}
@ -3489,7 +3489,8 @@ bool ASTReader::ReadSubmoduleBlock(ModuleFile &F) {
bool InferSubmodules = Record[5];
bool InferExplicitSubmodules = Record[6];
bool InferExportWildcard = Record[7];
bool ConfigMacrosExhaustive = Record[8];
Module *ParentModule = 0;
if (Parent)
ParentModule = getSubmodule(Parent);
@ -3527,13 +3528,15 @@ bool ASTReader::ReadSubmoduleBlock(ModuleFile &F) {
CurrentModule->InferSubmodules = InferSubmodules;
CurrentModule->InferExplicitSubmodules = InferExplicitSubmodules;
CurrentModule->InferExportWildcard = InferExportWildcard;
CurrentModule->ConfigMacrosExhaustive = ConfigMacrosExhaustive;
if (DeserializationListener)
DeserializationListener->ModuleRead(GlobalID, CurrentModule);
SubmodulesLoaded[GlobalIndex] = CurrentModule;
// Clear out link libraries; the module file has them.
// Clear out link libraries and config macros; the module file has them.
CurrentModule->LinkLibraries.clear();
CurrentModule->ConfigMacros.clear();
break;
}