Index: cfe/trunk/include/clang/AST/ODRHash.h =================================================================== --- cfe/trunk/include/clang/AST/ODRHash.h +++ cfe/trunk/include/clang/AST/ODRHash.h @@ -40,7 +40,6 @@ // Use DenseMaps to convert from DeclarationName and Type pointers // to an index value. llvm::DenseMap DeclNameMap; - llvm::DenseMap TypeMap; // Save space by processing bools at the end. llvm::SmallVector Bools; Index: cfe/trunk/lib/AST/ODRHash.cpp =================================================================== --- cfe/trunk/lib/AST/ODRHash.cpp +++ cfe/trunk/lib/AST/ODRHash.cpp @@ -180,7 +180,6 @@ void ODRHash::clear() { DeclNameMap.clear(); - TypeMap.clear(); Bools.clear(); ID.clear(); } @@ -770,14 +769,6 @@ void ODRHash::AddType(const Type *T) { assert(T && "Expecting non-null pointer."); - auto Result = TypeMap.insert(std::make_pair(T, TypeMap.size())); - ID.AddInteger(Result.first->second); - // On first encounter of a Type pointer, process it. Every time afterwards, - // only the index value is needed. - if (!Result.second) { - return; - } - ODRTypeVisitor(ID, *this).Visit(T); } Index: cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/first.h =================================================================== --- cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/first.h +++ cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/first.h @@ -0,0 +1,6 @@ +#ifndef FIRST +#define FIRST + +#include "textual_time.h" + +#endif Index: cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/module.modulemap =================================================================== --- cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/module.modulemap +++ cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/module.modulemap @@ -0,0 +1,5 @@ +module M { + module first { header "first.h" export *} + module second { header "second.h" export *} + export * +} Index: cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/second.h =================================================================== --- cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/second.h +++ cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/second.h @@ -0,0 +1,6 @@ +#ifndef SECOND +#define SECOND + +#include "textual_stat.h" + +#endif Index: cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_stat.h =================================================================== --- cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_stat.h +++ cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_stat.h @@ -0,0 +1,11 @@ +#ifndef _SYS_STAT_H +#define _SYS_STAT_H + +#include "textual_time.h" + +struct stat { + struct timespec st_atim; + struct timespec st_mtim; +}; + +#endif Index: cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_time.h =================================================================== --- cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_time.h +++ cfe/trunk/test/Modules/Inputs/odr_hash-elaborated-types/textual_time.h @@ -0,0 +1,6 @@ +#ifndef _TIME_H +#define _TIME_H + +struct timespec { }; + +#endif Index: cfe/trunk/test/Modules/odr_hash-elaborated-types.cpp =================================================================== --- cfe/trunk/test/Modules/odr_hash-elaborated-types.cpp +++ cfe/trunk/test/Modules/odr_hash-elaborated-types.cpp @@ -0,0 +1,12 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -std=c++1z -I%S/Inputs/odr_hash-elaborated-types -verify %s +// RUN: %clang_cc1 -std=c++1z -fmodules -fmodules-local-submodule-visibility -fmodule-map-file=%S/Inputs/odr_hash-elaborated-types/module.modulemap -fmodules-cache-path=%t -x c++ -I%S/Inputs/odr_hash-elaborated-types -verify %s + +#include "textual_stat.h" + +#include "first.h" +#include "second.h" + +void use() { struct stat value; } + +// expected-no-diagnostics