зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1753859 - Adjust clang patches to newest trunk. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D138115
This commit is contained in:
Родитель
8d35881c8d
Коммит
7ad2484904
|
@ -11,8 +11,8 @@
|
|||
"loosen-msvc-detection.patch",
|
||||
"fuzzing_ccov_build_clang_12.patch",
|
||||
"compiler-rt-13-no-codesign.patch",
|
||||
"revert-llvmorg-14-init-3652-gf3c2094d8c11.patch",
|
||||
"revert-llvmorg-14-init-3651-g85ba583eba19.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"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
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:
|
|
@ -0,0 +1,15 @@
|
|||
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:
|
Загрузка…
Ссылка в новой задаче