aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r--lib/Serialization/ASTReader.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index ef8481488302..5cabd0e6740d 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -9348,12 +9348,6 @@ void ASTReader::diagnoseOdrViolations() {
return Hash.CalculateHash();
};
- auto ComputeDeclNameODRHash = [&Hash](const DeclarationName Name) {
- Hash.clear();
- Hash.AddDeclarationName(Name);
- return Hash.CalculateHash();
- };
-
auto ComputeQualTypeODRHash = [&Hash](QualType Ty) {
Hash.clear();
Hash.AddQualType(Ty);
@@ -9446,11 +9440,8 @@ void ASTReader::diagnoseOdrViolations() {
QualType FirstType = FirstField->getType();
QualType SecondType = SecondField->getType();
- const TypedefType *FirstTypedef = dyn_cast<TypedefType>(FirstType);
- const TypedefType *SecondTypedef = dyn_cast<TypedefType>(SecondType);
-
- if ((FirstTypedef && !SecondTypedef) ||
- (!FirstTypedef && SecondTypedef)) {
+ if (ComputeQualTypeODRHash(FirstType) !=
+ ComputeQualTypeODRHash(SecondType)) {
ODRDiagError(FirstField->getLocation(), FirstField->getSourceRange(),
FieldTypeName)
<< FirstII << FirstType;
@@ -9462,24 +9453,6 @@ void ASTReader::diagnoseOdrViolations() {
break;
}
- if (FirstTypedef && SecondTypedef) {
- unsigned FirstHash = ComputeDeclNameODRHash(
- FirstTypedef->getDecl()->getDeclName());
- unsigned SecondHash = ComputeDeclNameODRHash(
- SecondTypedef->getDecl()->getDeclName());
- if (FirstHash != SecondHash) {
- ODRDiagError(FirstField->getLocation(),
- FirstField->getSourceRange(), FieldTypeName)
- << FirstII << FirstType;
- ODRDiagNote(SecondField->getLocation(),
- SecondField->getSourceRange(), FieldTypeName)
- << SecondII << SecondType;
-
- Diagnosed = true;
- break;
- }
- }
-
const bool IsFirstBitField = FirstField->isBitField();
const bool IsSecondBitField = SecondField->isBitField();
if (IsFirstBitField != IsSecondBitField) {