Bug 1754668 - Adjust clang trunk patches. r=firefox-build-system-reviewers,andi

llvmorg-13-init-8182-gc2297544c047 was finally backed out upstream which
means we don't need to revert it or its followups
(llvmorg-14-init-3651-g85ba583eba19 and llvmorg-14-init-3652-gf3c2094d8c11)

Differential Revision: https://phabricator.services.mozilla.com/D138399
This commit is contained in:
Mike Hommey 2022-02-11 03:54:04 +00:00
parent 194a013384
commit dbc7289949
4 changed files with 14 additions and 84 deletions

View File

@ -1,6 +1,6 @@
{
"patches": [
"static-llvm-symbolizer_clang_12.patch",
"static-llvm-symbolizer_clang_15.patch",
"compiler-rt-cross-compile.patch",
"find_symbolizer_linux_clang_10.patch",
"android-mangling-error_clang_12.patch",
@ -10,9 +10,6 @@
"Remove-FlushViewOfFile-when-unmaping-gcda-files.patch",
"loosen-msvc-detection.patch",
"fuzzing_ccov_build_clang_12.patch",
"compiler-rt-13-no-codesign.patch",
"revert-llvmorg-14-init-3652-gf3c2094d8c11-clang-14.patch",
"revert-llvmorg-14-init-3651-g85ba583eba19-clang-14.patch",
"revert-llvmorg-13-init-8182-gc2297544c047.patch"
"compiler-rt-13-no-codesign.patch"
]
}

View File

@ -1,64 +0,0 @@
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 7ee4cdbb6ef0..5e7f7c0c68b6 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2091,6 +2091,24 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
// allows it to work on indirect virtual function calls.
if (AttrOnCallSite && TargetDecl->hasAttr<NoMergeAttr>())
FuncAttrs.addAttribute(llvm::Attribute::NoMerge);
+
+ // Add known guaranteed alignment for allocation functions.
+ if (unsigned BuiltinID = Fn->getBuiltinID()) {
+ switch (BuiltinID) {
+ case Builtin::BIaligned_alloc:
+ case Builtin::BIcalloc:
+ case Builtin::BImalloc:
+ case Builtin::BImemalign:
+ case Builtin::BIrealloc:
+ case Builtin::BIstrdup:
+ case Builtin::BIstrndup:
+ RetAttrs.addAlignmentAttr(Context.getTargetInfo().getNewAlign() /
+ Context.getTargetInfo().getCharWidth());
+ break;
+ default:
+ break;
+ }
+ }
}
// 'const', 'pure' and 'noalias' attributed functions are also nounwind.
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f2a043ee3135..d0e65cd677da 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -15313,30 +15313,6 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
FD->addAttr(CUDAHostAttr::CreateImplicit(Context, FD->getLocation()));
}
- // Add known guaranteed alignment for allocation functions.
- switch (BuiltinID) {
- case Builtin::BImemalign:
- case Builtin::BIaligned_alloc:
- case Builtin::BIcalloc:
- case Builtin::BImalloc:
- case Builtin::BIrealloc:
- case Builtin::BIstrdup:
- case Builtin::BIstrndup: {
- if (!FD->hasAttr<AssumeAlignedAttr>()) {
- unsigned NewAlign = Context.getTargetInfo().getNewAlign() /
- Context.getTargetInfo().getCharWidth();
- IntegerLiteral *Alignment = IntegerLiteral::Create(
- Context, Context.MakeIntValue(NewAlign, Context.UnsignedIntTy),
- Context.UnsignedIntTy, FD->getLocation());
- FD->addAttr(AssumeAlignedAttr::CreateImplicit(
- Context, Alignment, /*Offset=*/nullptr, FD->getLocation()));
- }
- break;
- }
- default:
- break;
- }
-
// Add allocsize attribute for allocation functions.
switch (BuiltinID) {
case Builtin::BIcalloc:

View File

@ -1,15 +0,0 @@
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index fce33991c4aa..f2a043ee3135 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -15317,10 +15317,6 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
switch (BuiltinID) {
case Builtin::BImemalign:
case Builtin::BIaligned_alloc:
- if (!FD->hasAttr<AllocAlignAttr>())
- FD->addAttr(AllocAlignAttr::CreateImplicit(Context, ParamIdx(1, FD),
- FD->getLocation()));
- LLVM_FALLTHROUGH;
case Builtin::BIcalloc:
case Builtin::BImalloc:
case Builtin::BIrealloc:

View File

@ -0,0 +1,12 @@
diff --git a/llvm/tools/llvm-symbolizer/CMakeLists.txt b/llvm/tools/llvm-symbolizer/CMakeLists.txt
index f1a6087c0047..faf51c9b5c45 100644
--- a/llvm/tools/llvm-symbolizer/CMakeLists.txt
+++ b/llvm/tools/llvm-symbolizer/CMakeLists.txt
@@ -18,6 +18,7 @@ set(LLVM_LINK_COMPONENTS
)
add_llvm_tool(llvm-symbolizer
+ DISABLE_LLVM_LINK_LLVM_DYLIB
llvm-symbolizer.cpp
DEPENDS