diff --git a/build/build-clang/D116020.patch b/build/build-clang/D116020.patch new file mode 100644 index 000000000000..648d5ef99c3a --- /dev/null +++ b/build/build-clang/D116020.patch @@ -0,0 +1,39 @@ +Index: clang/lib/AST/Mangle.cpp +=================================================================== +--- a/clang/lib/AST/Mangle.cpp ++++ b/clang/lib/AST/Mangle.cpp +@@ -225,11 +225,17 @@ + if (const CXXMethodDecl *MD = dyn_cast(FD)) + if (!MD->isStatic()) + ++ArgWords; +- for (const auto &AT : Proto->param_types()) ++ for (const auto &AT : Proto->param_types()) { ++ // If an argument type is incomplete there is no way to get its size to ++ // correctly encode into the mangling scheme. ++ // Follow GCCs behaviour by simply breaking out of the loop. ++ if (AT->isIncompleteType()) ++ break; + // Size should be aligned to pointer size. + ArgWords += + llvm::alignTo(ASTContext.getTypeSize(AT), TI.getPointerWidth(0)) / + TI.getPointerWidth(0); ++ } + Out << ((TI.getPointerWidth(0) / 8) * ArgWords); + } + +Index: clang/test/CodeGen/pr52782-stdcall-func-decl.cpp +=================================================================== +--- /dev/null ++++ b/clang/test/CodeGen/pr52782-stdcall-func-decl.cpp +@@ -0,0 +1,11 @@ ++// RUN: %clang_cc1 -triple i686-w64-windows-gnu -o - -emit-llvm -debug-info-kind=constructor %s ++ ++#define NS_IMETHOD_(type) type __stdcall ++ ++enum nsresult {}; ++ ++class NotNull; ++ ++class nsICanvasRenderingContextInternal { ++ NS_IMETHOD_(nsresult) InitializeWithDrawTarget(NotNull); ++} nsTBaseHashSet; diff --git a/build/build-clang/clang-13.json b/build/build-clang/clang-13.json index 0f1b41deeb9c..621e975ebb25 100644 --- a/build/build-clang/clang-13.json +++ b/build/build-clang/clang-13.json @@ -19,6 +19,7 @@ "llvmorg-14-init-4465-g22ea0cea595e-v2.patch", "llvmorg-14-init-6706-g6404f4b5af39.patch", "llvmorg-14-init-9105-g3c47c5ca13b8.patch", - "llvmorg-14-init-11347-g93a20ecee4b6.patch" + "llvmorg-14-init-11347-g93a20ecee4b6.patch", + "D116020.patch" ] }