Re: r298816 - Revert 298754 and 298742.

2017-04-11 Thread Richard Trieu via cfe-commits
r299989 should prevent the build breakages.  I have recommited my changes
in r31.

On Sun, Mar 26, 2017 at 11:32 AM, Vassil Vassilev via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: vvassilev
> Date: Sun Mar 26 13:32:53 2017
> New Revision: 298816
>
> URL: http://llvm.org/viewvc/llvm-project?rev=298816=rev
> Log:
> Revert 298754 and 298742.
>
> They broke llvm modules builds and our internal modules infrastructure.
>
> Modified:
> cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> cfe/trunk/lib/AST/ODRHash.cpp
> cfe/trunk/lib/Serialization/ASTReader.cpp
> cfe/trunk/test/Modules/odr_hash.cpp
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/
> DiagnosticSerializationKinds.td?rev=298816=298815=298816=diff
> 
> ==
> --- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Sun Mar
> 26 13:32:53 2017
> @@ -148,7 +148,7 @@ def err_module_odr_violation_mismatch_de
>"method %4 is %select{not const|const}5|"
>"method %4 is %select{not inline|inline}5|"
>"method %4 that has %5 parameter%s5|"
> -  "method %4 with %ordinal5 parameter of type %6%select{| decayed from
> %8}7|"
> +  "method %4 with %ordinal5 parameter of type %6|"
>"method %4 with %ordinal5 parameter named %6|"
>"method %4 with %ordinal5 parameter with %select{no |}6default
> argument|"
>"method %4 with %ordinal5 parameter with default argument}3">;
> @@ -173,7 +173,7 @@ def note_module_odr_violation_mismatch_d
>"method %2 is %select{not const|const}3|"
>"method %2 is %select{not inline|inline}3|"
>"method %2 that has %3 parameter%s3|"
> -  "method %2 with %ordinal3 parameter of type %4%select{| decayed from
> %6}5|"
> +  "method %2 with %ordinal3 parameter of type %4|"
>"method %2 with %ordinal3 parameter named %4|"
>"method %2 with %ordinal3 parameter with %select{no |}4default
> argument|"
>"method %2 with %ordinal3 parameter with different default argument}1">;
>
> Modified: cfe/trunk/lib/AST/ODRHash.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/
> ODRHash.cpp?rev=298816=298815=298816=diff
> 
> ==
> --- cfe/trunk/lib/AST/ODRHash.cpp (original)
> +++ cfe/trunk/lib/AST/ODRHash.cpp Sun Mar 26 13:32:53 2017
> @@ -330,10 +330,6 @@ public:
>  Hash.AddQualType(T);
>}
>
> -  void VisitQualifiers(Qualifiers Quals) {
> -ID.AddInteger(Quals.getAsOpaqueValue());
> -  }
> -
>void Visit(const Type *T) {
>  ID.AddInteger(T->getTypeClass());
>  Inherited::Visit(T);
> @@ -341,43 +337,6 @@ public:
>
>void VisitType(const Type *T) {}
>
> -  void VisitAdjustedType(const AdjustedType *T) {
> -AddQualType(T->getOriginalType());
> -AddQualType(T->getAdjustedType());
> -VisitType(T);
> -  }
> -
> -  void VisitDecayedType(const DecayedType *T) {
> -AddQualType(T->getDecayedType());
> -AddQualType(T->getPointeeType());
> -VisitAdjustedType(T);
> -  }
> -
> -  void VisitArrayType(const ArrayType *T) {
> -AddQualType(T->getElementType());
> -ID.AddInteger(T->getSizeModifier());
> -VisitQualifiers(T->getIndexTypeQualifiers());
> -VisitType(T);
> -  }
> -  void VisitConstantArrayType(const ConstantArrayType *T) {
> -T->getSize().Profile(ID);
> -VisitArrayType(T);
> -  }
> -
> -  void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
> -AddStmt(T->getSizeExpr());
> -VisitArrayType(T);
> -  }
> -
> -  void VisitIncompleteArrayType(const IncompleteArrayType *T) {
> -VisitArrayType(T);
> -  }
> -
> -  void VisitVariableArrayType(const VariableArrayType *T) {
> -AddStmt(T->getSizeExpr());
> -VisitArrayType(T);
> -  }
> -
>void VisitBuiltinType(const BuiltinType *T) {
>  ID.AddInteger(T->getKind());
>  VisitType(T);
>
> Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/
> Serialization/ASTReader.cpp?rev=298816=298815=298816=diff
> 
> ==
> --- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReader.cpp Sun Mar 26 13:32:53 2017
> @@ -9586,33 +9586,13 @@ void ASTReader::diagnoseOdrViolations()
>  for (unsigned I = 0; I < FirstNumParameters; ++I) {
>const ParmVarDecl *FirstParam = FirstMethod->getParamDecl(I);
>const ParmVarDecl *SecondParam = SecondMethod->getParamDecl(I);
> -
> -  QualType FirstParamType = FirstParam->getType();
> -  QualType SecondParamType = SecondParam->getType();
> -  if (FirstParamType != SecondParamType) {
> -if (const DecayedType *ParamDecayedType =
> -

r298816 - Revert 298754 and 298742.

2017-03-26 Thread Vassil Vassilev via cfe-commits
Author: vvassilev
Date: Sun Mar 26 13:32:53 2017
New Revision: 298816

URL: http://llvm.org/viewvc/llvm-project?rev=298816=rev
Log:
Revert 298754 and 298742.

They broke llvm modules builds and our internal modules infrastructure.

Modified:
cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
cfe/trunk/lib/AST/ODRHash.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/test/Modules/odr_hash.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=298816=298815=298816=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Sun Mar 26 
13:32:53 2017
@@ -148,7 +148,7 @@ def err_module_odr_violation_mismatch_de
   "method %4 is %select{not const|const}5|"
   "method %4 is %select{not inline|inline}5|"
   "method %4 that has %5 parameter%s5|"
-  "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|"
+  "method %4 with %ordinal5 parameter of type %6|"
   "method %4 with %ordinal5 parameter named %6|"
   "method %4 with %ordinal5 parameter with %select{no |}6default argument|"
   "method %4 with %ordinal5 parameter with default argument}3">;
@@ -173,7 +173,7 @@ def note_module_odr_violation_mismatch_d
   "method %2 is %select{not const|const}3|"
   "method %2 is %select{not inline|inline}3|"
   "method %2 that has %3 parameter%s3|"
-  "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|"
+  "method %2 with %ordinal3 parameter of type %4|"
   "method %2 with %ordinal3 parameter named %4|"
   "method %2 with %ordinal3 parameter with %select{no |}4default argument|"
   "method %2 with %ordinal3 parameter with different default argument}1">;

Modified: cfe/trunk/lib/AST/ODRHash.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ODRHash.cpp?rev=298816=298815=298816=diff
==
--- cfe/trunk/lib/AST/ODRHash.cpp (original)
+++ cfe/trunk/lib/AST/ODRHash.cpp Sun Mar 26 13:32:53 2017
@@ -330,10 +330,6 @@ public:
 Hash.AddQualType(T);
   }
 
-  void VisitQualifiers(Qualifiers Quals) {
-ID.AddInteger(Quals.getAsOpaqueValue());
-  }
-
   void Visit(const Type *T) {
 ID.AddInteger(T->getTypeClass());
 Inherited::Visit(T);
@@ -341,43 +337,6 @@ public:
 
   void VisitType(const Type *T) {}
 
-  void VisitAdjustedType(const AdjustedType *T) {
-AddQualType(T->getOriginalType());
-AddQualType(T->getAdjustedType());
-VisitType(T);
-  }
-
-  void VisitDecayedType(const DecayedType *T) {
-AddQualType(T->getDecayedType());
-AddQualType(T->getPointeeType());
-VisitAdjustedType(T);
-  }
-
-  void VisitArrayType(const ArrayType *T) {
-AddQualType(T->getElementType());
-ID.AddInteger(T->getSizeModifier());
-VisitQualifiers(T->getIndexTypeQualifiers());
-VisitType(T);
-  }
-  void VisitConstantArrayType(const ConstantArrayType *T) {
-T->getSize().Profile(ID);
-VisitArrayType(T);
-  }
-
-  void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
-AddStmt(T->getSizeExpr());
-VisitArrayType(T);
-  }
-
-  void VisitIncompleteArrayType(const IncompleteArrayType *T) {
-VisitArrayType(T);
-  }
-
-  void VisitVariableArrayType(const VariableArrayType *T) {
-AddStmt(T->getSizeExpr());
-VisitArrayType(T);
-  }
-
   void VisitBuiltinType(const BuiltinType *T) {
 ID.AddInteger(T->getKind());
 VisitType(T);

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=298816=298815=298816=diff
==
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Sun Mar 26 13:32:53 2017
@@ -9586,33 +9586,13 @@ void ASTReader::diagnoseOdrViolations()
 for (unsigned I = 0; I < FirstNumParameters; ++I) {
   const ParmVarDecl *FirstParam = FirstMethod->getParamDecl(I);
   const ParmVarDecl *SecondParam = SecondMethod->getParamDecl(I);
-
-  QualType FirstParamType = FirstParam->getType();
-  QualType SecondParamType = SecondParam->getType();
-  if (FirstParamType != SecondParamType) {
-if (const DecayedType *ParamDecayedType =
-FirstParamType->getAs()) {
-  ODRDiagError(FirstMethod->getLocation(),
-   FirstMethod->getSourceRange(), MethodParameterType)
-  << FirstName << (I + 1) << FirstParamType << true
-  << ParamDecayedType->getOriginalType();
-} else {
-  ODRDiagError(FirstMethod->getLocation(),
-