зеркало из https://github.com/mozilla/gecko-dev.git
46 строки
1.9 KiB
Diff
46 строки
1.9 KiB
Diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
|
|
index 421ca95bb543..506af5d1458c 100644
|
|
--- a/clang/lib/Sema/SemaDecl.cpp
|
|
+++ b/clang/lib/Sema/SemaDecl.cpp
|
|
@@ -15219,10 +15219,6 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
|
|
// Add known guaranteed alignment for allocation functions.
|
|
switch (BuiltinID) {
|
|
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::BImemalign:
|
|
diff --git a/clang/test/CodeGen/alloc-fns-alignment.c b/clang/test/CodeGen/alloc-fns-alignment.c
|
|
index b19cf867f74c..1ce0cfbad97b 100644
|
|
--- a/clang/test/CodeGen/alloc-fns-alignment.c
|
|
+++ b/clang/test/CodeGen/alloc-fns-alignment.c
|
|
@@ -48,14 +48,13 @@ void *aligned_alloc_large_constant_test(size_t n) {
|
|
// ALIGN16: align 16 i8* @realloc
|
|
|
|
// CHECK-LABEL: @aligned_alloc_variable_test
|
|
-// ALIGN16: %[[ALLOCATED:.*]] = call align 16 i8* @aligned_alloc({{i32|i64}} %[[ALIGN:.*]], {{i32|i64}} %[[NBYTES:.*]])
|
|
-// ALIGN16-NEXT: call void @llvm.assume(i1 true) [ "align"(i8* %[[ALLOCATED]], {{i32|i64}} %[[ALIGN]]) ]
|
|
+// ALIGN16: align 16 i8* @aligned_alloc
|
|
|
|
// CHECK-LABEL: @aligned_alloc_constant_test
|
|
// ALIGN16: align 16 i8* @aligned_alloc
|
|
|
|
// CHECK-LABEL: @aligned_alloc_large_constant_test
|
|
-// ALIGN16: align 4096 i8* @aligned_alloc
|
|
+// ALIGN16: align 16 i8* @aligned_alloc
|
|
|
|
// CHECK-LABEL: @malloc_test
|
|
// ALIGN8: align 8 i8* @malloc
|
|
@@ -73,7 +72,7 @@ void *aligned_alloc_large_constant_test(size_t n) {
|
|
// ALIGN8: align 8 i8* @aligned_alloc
|
|
|
|
// CHECK-LABEL: @aligned_alloc_large_constant_test
|
|
-// ALIGN8: align 4096 i8* @aligned_alloc
|
|
+// ALIGN8: align 8 i8* @aligned_alloc
|
|
|
|
// NOBUILTIN-MALLOC: declare i8* @malloc
|
|
// NOBUILTIN-CALLOC: declare i8* @calloc
|