Re: r298824 - Revert r298742 "[ODRHash] Add error messages for mismatched parameters in methods."

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 2:39 PM, Vassil Vassilev via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: vvassilev
> Date: Sun Mar 26 16:39:16 2017
> New Revision: 298824
>
> URL: http://llvm.org/viewvc/llvm-project?rev=298824=rev
> Log:
> Revert r298742 "[ODRHash] Add error messages for mismatched parameters in
> methods."
>
> I failed to revert this in r298816.
>
> 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=298824=298823=298824=diff
> 
> ==
> --- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Sun Mar
> 26 16:39:16 2017
> @@ -146,12 +146,7 @@ def err_module_odr_violation_mismatch_de
>"method %4 is %select{not static|static}5|"
>"method %4 is %select{not volatile|volatile}5|"
>"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|"
> -  "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">;
> +  "method %4 is %select{not inline|inline}5}3">;
>
>  def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0'
> found "
>"%select{"
> @@ -171,12 +166,7 @@ def note_module_odr_violation_mismatch_d
>"method %2 is %select{not static|static}3|"
>"method %2 is %select{not volatile|volatile}3|"
>"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|"
> -  "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">;
> +  "method %2 is %select{not inline|inline}3}1">;
>
>  def warn_module_uses_date_time : Warning<
>"%select{precompiled header|module}0 uses __DATE__ or __TIME__">,
>
> Modified: cfe/trunk/lib/AST/ODRHash.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/
> ODRHash.cpp?rev=298824=298823=298824=diff
> 
> ==
> --- cfe/trunk/lib/AST/ODRHash.cpp (original)
> +++ cfe/trunk/lib/AST/ODRHash.cpp Sun Mar 26 16:39:16 2017
> @@ -169,11 +169,6 @@ public:
>  Inherited::VisitValueDecl(D);
>}
>
> -  void VisitParmVarDecl(const ParmVarDecl *D) {
> -AddStmt(D->getDefaultArg());
> -Inherited::VisitParmVarDecl(D);
> -  }
> -
>void VisitAccessSpecDecl(const AccessSpecDecl *D) {
>  ID.AddInteger(D->getAccess());
>  Inherited::VisitAccessSpecDecl(D);
> @@ -207,12 +202,6 @@ public:
>  Hash.AddBoolean(D->isPure());
>  Hash.AddBoolean(D->isDeletedAsWritten());
>
> -ID.AddInteger(D->param_size());
> -
> -for (auto *Param : D->parameters()) {
> -  Hash.AddSubDecl(Param);
> -}
> -
>  Inherited::VisitFunctionDecl(D);
>}
>
> @@ -326,10 +315,6 @@ public:
>  }
>}
>
> -  void AddQualType(QualType T) {
> -Hash.AddQualType(T);
> -  }
> -
>void Visit(const Type *T) {
>  ID.AddInteger(T->getTypeClass());
>  Inherited::Visit(T);
> @@ -342,50 +327,6 @@ public:
>  VisitType(T);
>}
>
> -  void VisitFunctionType(const FunctionType *T) {
> -AddQualType(T->getReturnType());
> -T->getExtInfo().Profile(ID);
> -Hash.AddBoolean(T->isConst());
> -Hash.AddBoolean(T->isVolatile());
> -Hash.AddBoolean(T->isRestrict());
> -VisitType(T);
> -  }
> -
> -  void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
> -VisitFunctionType(T);
> -  }
> -
> -  void VisitFunctionProtoType(const FunctionProtoType *T) {
> -ID.AddInteger(T->getNumParams());
> -for (auto ParamType : T->getParamTypes())
> -  AddQualType(ParamType);
> -
> -const auto  = T->getExtProtoInfo();
> -ID.AddInteger(epi.Variadic);
> -ID.AddInteger(epi.TypeQuals);
> -ID.AddInteger(epi.RefQualifier);
> -ID.AddInteger(epi.ExceptionSpec.Type);
> -
> -if (epi.ExceptionSpec.Type == EST_Dynamic) {
> -  for (QualType Ex : epi.ExceptionSpec.Exceptions)
> -AddQualType(Ex);
> -} else if (epi.ExceptionSpec.Type == EST_ComputedNoexcept &&
> -   epi.ExceptionSpec.NoexceptExpr) {
> -  AddStmt(epi.ExceptionSpec.NoexceptExpr);
> -} else if 

r298824 - Revert r298742 "[ODRHash] Add error messages for mismatched parameters in methods."

2017-03-26 Thread Vassil Vassilev via cfe-commits
Author: vvassilev
Date: Sun Mar 26 16:39:16 2017
New Revision: 298824

URL: http://llvm.org/viewvc/llvm-project?rev=298824=rev
Log:
Revert r298742 "[ODRHash] Add error messages for mismatched parameters in 
methods."

I failed to revert this in r298816.

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=298824=298823=298824=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Sun Mar 26 
16:39:16 2017
@@ -146,12 +146,7 @@ def err_module_odr_violation_mismatch_de
   "method %4 is %select{not static|static}5|"
   "method %4 is %select{not volatile|volatile}5|"
   "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|"
-  "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">;
+  "method %4 is %select{not inline|inline}5}3">;
 
 def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found "
   "%select{"
@@ -171,12 +166,7 @@ def note_module_odr_violation_mismatch_d
   "method %2 is %select{not static|static}3|"
   "method %2 is %select{not volatile|volatile}3|"
   "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|"
-  "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">;
+  "method %2 is %select{not inline|inline}3}1">;
 
 def warn_module_uses_date_time : Warning<
   "%select{precompiled header|module}0 uses __DATE__ or __TIME__">,

Modified: cfe/trunk/lib/AST/ODRHash.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ODRHash.cpp?rev=298824=298823=298824=diff
==
--- cfe/trunk/lib/AST/ODRHash.cpp (original)
+++ cfe/trunk/lib/AST/ODRHash.cpp Sun Mar 26 16:39:16 2017
@@ -169,11 +169,6 @@ public:
 Inherited::VisitValueDecl(D);
   }
 
-  void VisitParmVarDecl(const ParmVarDecl *D) {
-AddStmt(D->getDefaultArg());
-Inherited::VisitParmVarDecl(D);
-  }
-
   void VisitAccessSpecDecl(const AccessSpecDecl *D) {
 ID.AddInteger(D->getAccess());
 Inherited::VisitAccessSpecDecl(D);
@@ -207,12 +202,6 @@ public:
 Hash.AddBoolean(D->isPure());
 Hash.AddBoolean(D->isDeletedAsWritten());
 
-ID.AddInteger(D->param_size());
-
-for (auto *Param : D->parameters()) {
-  Hash.AddSubDecl(Param);
-}
-
 Inherited::VisitFunctionDecl(D);
   }
 
@@ -326,10 +315,6 @@ public:
 }
   }
 
-  void AddQualType(QualType T) {
-Hash.AddQualType(T);
-  }
-
   void Visit(const Type *T) {
 ID.AddInteger(T->getTypeClass());
 Inherited::Visit(T);
@@ -342,50 +327,6 @@ public:
 VisitType(T);
   }
 
-  void VisitFunctionType(const FunctionType *T) {
-AddQualType(T->getReturnType());
-T->getExtInfo().Profile(ID);
-Hash.AddBoolean(T->isConst());
-Hash.AddBoolean(T->isVolatile());
-Hash.AddBoolean(T->isRestrict());
-VisitType(T);
-  }
-
-  void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
-VisitFunctionType(T);
-  }
-
-  void VisitFunctionProtoType(const FunctionProtoType *T) {
-ID.AddInteger(T->getNumParams());
-for (auto ParamType : T->getParamTypes())
-  AddQualType(ParamType);
-
-const auto  = T->getExtProtoInfo();
-ID.AddInteger(epi.Variadic);
-ID.AddInteger(epi.TypeQuals);
-ID.AddInteger(epi.RefQualifier);
-ID.AddInteger(epi.ExceptionSpec.Type);
-
-if (epi.ExceptionSpec.Type == EST_Dynamic) {
-  for (QualType Ex : epi.ExceptionSpec.Exceptions)
-AddQualType(Ex);
-} else if (epi.ExceptionSpec.Type == EST_ComputedNoexcept &&
-   epi.ExceptionSpec.NoexceptExpr) {
-  AddStmt(epi.ExceptionSpec.NoexceptExpr);
-} else if (epi.ExceptionSpec.Type == EST_Uninstantiated ||
-   epi.ExceptionSpec.Type == EST_Unevaluated) {
-  AddDecl(epi.ExceptionSpec.SourceDecl->getCanonicalDecl());
-}
-if (epi.ExtParameterInfos) {
-  for (unsigned i = 0; i != T->getNumParams(); ++i)
-ID.AddInteger(epi.ExtParameterInfos[i].getOpaqueValue());
-}
-epi.ExtInfo.Profile(ID);
-Hash.AddBoolean(epi.HasTrailingReturn);
-
-VisitFunctionType(T);
-