<div dir="ltr">r299989 should prevent the build breakages. I have recommited my changes in r300001.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 26, 2017 at 11:32 AM, Vassil Vassilev via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vvassilev<br>
Date: Sun Mar 26 13:32:53 2017<br>
New Revision: 298816<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=298816&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=298816&view=rev</a><br>
Log:<br>
Revert 298754 and 298742.<br>
<br>
They broke llvm modules builds and our internal modules infrastructure.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/Basic/<wbr>DiagnosticSerializationKinds.<wbr>td<br>
cfe/trunk/lib/AST/ODRHash.cpp<br>
cfe/trunk/lib/Serialization/<wbr>ASTReader.cpp<br>
cfe/trunk/test/Modules/odr_<wbr>hash.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Basic/<wbr>DiagnosticSerializationKinds.<wbr>td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=298816&r1=298815&r2=298816&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Basic/<wbr>DiagnosticSerializationKinds.<wbr>td?rev=298816&r1=298815&r2=<wbr>298816&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/Basic/<wbr>DiagnosticSerializationKinds.<wbr>td (original)<br>
+++ cfe/trunk/include/clang/Basic/<wbr>DiagnosticSerializationKinds.<wbr>td Sun Mar 26 13:32:53 2017<br>
@@ -148,7 +148,7 @@ def err_module_odr_violation_<wbr>mismatch_de<br>
"method %4 is %select{not const|const}5|"<br>
"method %4 is %select{not inline|inline}5|"<br>
"method %4 that has %5 parameter%s5|"<br>
- "method %4 with %ordinal5 parameter of type %6%select{| decayed from %8}7|"<br>
+ "method %4 with %ordinal5 parameter of type %6|"<br>
"method %4 with %ordinal5 parameter named %6|"<br>
"method %4 with %ordinal5 parameter with %select{no |}6default argument|"<br>
"method %4 with %ordinal5 parameter with default argument}3">;<br>
@@ -173,7 +173,7 @@ def note_module_odr_violation_<wbr>mismatch_d<br>
"method %2 is %select{not const|const}3|"<br>
"method %2 is %select{not inline|inline}3|"<br>
"method %2 that has %3 parameter%s3|"<br>
- "method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|"<br>
+ "method %2 with %ordinal3 parameter of type %4|"<br>
"method %2 with %ordinal3 parameter named %4|"<br>
"method %2 with %ordinal3 parameter with %select{no |}4default argument|"<br>
"method %2 with %ordinal3 parameter with different default argument}1">;<br>
<br>
Modified: cfe/trunk/lib/AST/ODRHash.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ODRHash.cpp?rev=298816&r1=298815&r2=298816&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/AST/<wbr>ODRHash.cpp?rev=298816&r1=<wbr>298815&r2=298816&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/AST/ODRHash.cpp (original)<br>
+++ cfe/trunk/lib/AST/ODRHash.cpp Sun Mar 26 13:32:53 2017<br>
@@ -330,10 +330,6 @@ public:<br>
Hash.AddQualType(T);<br>
}<br>
<br>
- void VisitQualifiers(Qualifiers Quals) {<br>
- ID.AddInteger(Quals.<wbr>getAsOpaqueValue());<br>
- }<br>
-<br>
void Visit(const Type *T) {<br>
ID.AddInteger(T->getTypeClass(<wbr>));<br>
Inherited::Visit(T);<br>
@@ -341,43 +337,6 @@ public:<br>
<br>
void VisitType(const Type *T) {}<br>
<br>
- void VisitAdjustedType(const AdjustedType *T) {<br>
- AddQualType(T-><wbr>getOriginalType());<br>
- AddQualType(T-><wbr>getAdjustedType());<br>
- VisitType(T);<br>
- }<br>
-<br>
- void VisitDecayedType(const DecayedType *T) {<br>
- AddQualType(T->getDecayedType(<wbr>));<br>
- AddQualType(T->getPointeeType(<wbr>));<br>
- VisitAdjustedType(T);<br>
- }<br>
-<br>
- void VisitArrayType(const ArrayType *T) {<br>
- AddQualType(T->getElementType(<wbr>));<br>
- ID.AddInteger(T-><wbr>getSizeModifier());<br>
- VisitQualifiers(T-><wbr>getIndexTypeQualifiers());<br>
- VisitType(T);<br>
- }<br>
- void VisitConstantArrayType(const ConstantArrayType *T) {<br>
- T->getSize().Profile(ID);<br>
- VisitArrayType(T);<br>
- }<br>
-<br>
- void VisitDependentSizedArrayType(<wbr>const DependentSizedArrayType *T) {<br>
- AddStmt(T->getSizeExpr());<br>
- VisitArrayType(T);<br>
- }<br>
-<br>
- void VisitIncompleteArrayType(const IncompleteArrayType *T) {<br>
- VisitArrayType(T);<br>
- }<br>
-<br>
- void VisitVariableArrayType(const VariableArrayType *T) {<br>
- AddStmt(T->getSizeExpr());<br>
- VisitArrayType(T);<br>
- }<br>
-<br>
void VisitBuiltinType(const BuiltinType *T) {<br>
ID.AddInteger(T->getKind());<br>
VisitType(T);<br>
<br>
Modified: cfe/trunk/lib/Serialization/<wbr>ASTReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=298816&r1=298815&r2=298816&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/<wbr>Serialization/ASTReader.cpp?<wbr>rev=298816&r1=298815&r2=<wbr>298816&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Serialization/<wbr>ASTReader.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/<wbr>ASTReader.cpp Sun Mar 26 13:32:53 2017<br>
@@ -9586,33 +9586,13 @@ void ASTReader::<wbr>diagnoseOdrViolations()<br>
for (unsigned I = 0; I < FirstNumParameters; ++I) {<br>
const ParmVarDecl *FirstParam = FirstMethod->getParamDecl(I);<br>
const ParmVarDecl *SecondParam = SecondMethod->getParamDecl(I);<br>
-<br>
- QualType FirstParamType = FirstParam->getType();<br>
- QualType SecondParamType = SecondParam->getType();<br>
- if (FirstParamType != SecondParamType) {<br>
- if (const DecayedType *ParamDecayedType =<br>
- FirstParamType->getAs<<wbr>DecayedType>()) {<br>
- ODRDiagError(FirstMethod-><wbr>getLocation(),<br>
- FirstMethod->getSourceRange(), MethodParameterType)<br>
- << FirstName << (I + 1) << FirstParamType << true<br>
- << ParamDecayedType-><wbr>getOriginalType();<br>
- } else {<br>
- ODRDiagError(FirstMethod-><wbr>getLocation(),<br>
- FirstMethod->getSourceRange(), MethodParameterType)<br>
- << FirstName << (I + 1) << FirstParamType << false;<br>
- }<br>
-<br>
- if (const DecayedType *ParamDecayedType =<br>
- SecondParamType->getAs<<wbr>DecayedType>()) {<br>
- ODRDiagNote(SecondMethod-><wbr>getLocation(),<br>
- SecondMethod->getSourceRange()<wbr>, MethodParameterType)<br>
- << SecondName << (I + 1) << SecondParamType << true<br>
- << ParamDecayedType-><wbr>getOriginalType();<br>
- } else {<br>
- ODRDiagNote(SecondMethod-><wbr>getLocation(),<br>
- SecondMethod->getSourceRange()<wbr>, MethodParameterType)<br>
- << SecondName << (I + 1) << SecondParamType << false;<br>
- }<br>
+ if (FirstParam->getType() != SecondParam->getType()) {<br>
+ ODRDiagError(FirstMethod-><wbr>getLocation(),<br>
+ FirstMethod->getSourceRange(), MethodParameterType)<br>
+ << FirstName << (I + 1) << FirstParam->getType();<br>
+ ODRDiagNote(SecondMethod-><wbr>getLocation(),<br>
+ SecondMethod->getSourceRange()<wbr>, MethodParameterType)<br>
+ << SecondName << (I + 1) << SecondParam->getType();<br>
ParameterMismatch = true;<br>
break;<br>
}<br>
<br>
Modified: cfe/trunk/test/Modules/odr_<wbr>hash.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/odr_hash.cpp?rev=298816&r1=298815&r2=298816&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>Modules/odr_hash.cpp?rev=<wbr>298816&r1=298815&r2=298816&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Modules/odr_<wbr>hash.cpp (original)<br>
+++ cfe/trunk/test/Modules/odr_<wbr>hash.cpp Sun Mar 26 13:32:53 2017<br>
@@ -275,33 +275,6 @@ S11 s11;<br>
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with a different initializer}}<br>
#endif<br>
<br>
-#if defined(FIRST)<br>
-struct S12 {<br>
- unsigned x[5];<br>
-};<br>
-#elif defined(SECOND)<br>
-struct S12 {<br>
- unsigned x[7];<br>
-};<br>
-#else<br>
-S12 s12;<br>
-// expected-error@first.h:* {{'Field::S12::x' from module 'FirstModule' is not present in definition of 'Field::S12' in module 'SecondModule'}}<br>
-// expected-note@second.h:* {{declaration of 'x' does not match}}<br>
-#endif<br>
-<br>
-#if defined(FIRST)<br>
-struct S13 {<br>
- unsigned x[7];<br>
-};<br>
-#elif defined(SECOND)<br>
-struct S13 {<br>
- double x[7];<br>
-};<br>
-#else<br>
-S13 s13;<br>
-// expected-error@first.h:* {{'Field::S13::x' from module 'FirstModule' is not present in definition of 'Field::S13' in module 'SecondModule'}}<br>
-// expected-note@second.h:* {{declaration of 'x' does not match}}<br>
-#endif<br>
} // namespace Field<br>
<br>
namespace Method {<br>
@@ -503,20 +476,6 @@ S13 s13;<br>
// expected-error@second.h:* {{'Method::S13' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter with default argument}}<br>
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter with different default argument}}<br>
#endif<br>
-<br>
-#if defined(FIRST)<br>
-struct S14 {<br>
- void A(int x[2]) {}<br>
-};<br>
-#elif defined(SECOND)<br>
-struct S14 {<br>
- void A(int x[3]) {}<br>
-};<br>
-#else<br>
-S14 s14;<br>
-// expected-error@second.h:* {{'Method::S14' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [3]'}}<br>
-// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [2]'}}<br>
-#endif<br>
} // namespace Method<br>
<br>
// Naive parsing of AST can lead to cycles in processing. Ensure<br>
@@ -638,52 +597,74 @@ S3 s3;<br>
<br>
// Interesting cases that should not cause errors. struct S should not error<br>
// while struct T should error at the access specifier mismatch at the end.<br>
-#define ALL_DECLS \<br>
-public: \<br>
-private: \<br>
-protected: \<br>
- static_assert(1 == 1, "Message"); \<br>
- static_assert(2 == 2); \<br>
- \<br>
- int x; \<br>
- double y; \<br>
- \<br>
- INT z; \<br>
- \<br>
- unsigned a : 1; \<br>
- unsigned b : 2 * 2 + 5 / 2; \<br>
- \<br>
- mutable int c = sizeof(x + y); \<br>
- \<br>
- void method() {} \<br>
- static void static_method() {} \<br>
- virtual void virtual_method() {} \<br>
- virtual void pure_virtual_method() = 0; \<br>
- inline void inline_method() {} \<br>
- void volatile_method() volatile {} \<br>
- void const_method() const {} \<br>
- \<br>
- typedef int typedef_int; \<br>
- using using_int = int; \<br>
- \<br>
- void method_one_arg(int x) {} \<br>
- void method_one_arg_default_<wbr>argument(int x = 5 + 5) {} \<br>
- void method_decayed_type(int x[5]) {} \<br>
- \<br>
- int constant_arr[5]; \<br>
- \<br>
- double last_decl;<br>
-<br>
namespace AllDecls {<br>
#if defined(FIRST)<br>
typedef int INT;<br>
struct S {<br>
- ALL_DECLS<br>
+ public:<br>
+ private:<br>
+ protected:<br>
+<br>
+ static_assert(1 == 1, "Message");<br>
+ static_assert(2 == 2);<br>
+<br>
+ int x;<br>
+ double y;<br>
+<br>
+ INT z;<br>
+<br>
+ unsigned a : 1;<br>
+ unsigned b : 2*2 + 5/2;<br>
+<br>
+ mutable int c = sizeof(x + y);<br>
+<br>
+ void method() {}<br>
+ static void static_method() {}<br>
+ virtual void virtual_method() {}<br>
+ virtual void pure_virtual_method() = 0;<br>
+ inline void inline_method() {}<br>
+ void volatile_method() volatile {}<br>
+ void const_method() const {}<br>
+<br>
+ typedef int typedef_int;<br>
+ using using_int = int;<br>
+<br>
+ void method_one_arg(int x) {}<br>
+ void method_one_arg_default_<wbr>argument(int x = 5 + 5) {}<br>
};<br>
#elif defined(SECOND)<br>
typedef int INT;<br>
struct S {<br>
- ALL_DECLS<br>
+ public:<br>
+ private:<br>
+ protected:<br>
+<br>
+ static_assert(1 == 1, "Message");<br>
+ static_assert(2 == 2);<br>
+<br>
+ int x;<br>
+ double y;<br>
+<br>
+ INT z;<br>
+<br>
+ unsigned a : 1;<br>
+ unsigned b : 2 * 2 + 5 / 2;<br>
+<br>
+ mutable int c = sizeof(x + y);<br>
+<br>
+ void method() {}<br>
+ static void static_method() {}<br>
+ virtual void virtual_method() {}<br>
+ virtual void pure_virtual_method() = 0;<br>
+ inline void inline_method() {}<br>
+ void volatile_method() volatile {}<br>
+ void const_method() const {}<br>
+<br>
+ typedef int typedef_int;<br>
+ using using_int = int;<br>
+<br>
+ void method_one_arg(int x) {}<br>
+ void method_one_arg_default_<wbr>argument(int x = 5 + 5) {}<br>
};<br>
#else<br>
S *s;<br>
@@ -692,14 +673,72 @@ S *s;<br>
#if defined(FIRST)<br>
typedef int INT;<br>
struct T {<br>
- ALL_DECLS<br>
+ public:<br>
+ private:<br>
+ protected:<br>
+<br>
+ static_assert(1 == 1, "Message");<br>
+ static_assert(2 == 2);<br>
+<br>
+ int x;<br>
+ double y;<br>
+<br>
+ INT z;<br>
+<br>
+ unsigned a : 1;<br>
+ unsigned b : 2 * 2 + 5 / 2;<br>
+<br>
+ mutable int c = sizeof(x + y);<br>
+<br>
+ void method() {}<br>
+ static void static_method() {}<br>
+ virtual void virtual_method() {}<br>
+ virtual void pure_virtual_method() = 0;<br>
+ inline void inline_method() {}<br>
+ void volatile_method() volatile {}<br>
+ void const_method() const {}<br>
+<br>
+ typedef int typedef_int;<br>
+ using using_int = int;<br>
+<br>
+ void method_one_arg(int x) {}<br>
+ void method_one_arg_default_<wbr>argument(int x = 5 + 5) {}<br>
<br>
private:<br>
};<br>
#elif defined(SECOND)<br>
typedef int INT;<br>
struct T {<br>
- ALL_DECLS<br>
+ public:<br>
+ private:<br>
+ protected:<br>
+<br>
+ static_assert(1 == 1, "Message");<br>
+ static_assert(2 == 2);<br>
+<br>
+ int x;<br>
+ double y;<br>
+<br>
+ INT z;<br>
+<br>
+ unsigned a : 1;<br>
+ unsigned b : 2 * 2 + 5 / 2;<br>
+<br>
+ mutable int c = sizeof(x + y);<br>
+<br>
+ void method() {}<br>
+ static void static_method() {}<br>
+ virtual void virtual_method() {}<br>
+ virtual void pure_virtual_method() = 0;<br>
+ inline void inline_method() {}<br>
+ void volatile_method() volatile {}<br>
+ void const_method() const {}<br>
+<br>
+ typedef int typedef_int;<br>
+ using using_int = int;<br>
+<br>
+ void method_one_arg(int x) {}<br>
+ void method_one_arg_default_<wbr>argument(int x = 5 + 5) {}<br>
<br>
public:<br>
};<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>