[llvm] 15c1ab2 - [Attributes] Remove special SRet/ByVal attribute handling in C API
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 11 00:42:07 PDT 2022
Author: Nikita Popov
Date: 2022-10-11T09:39:39+02:00
New Revision: 15c1ab25ab85cb62a305664cc8b418a9b912bf4e
URL: https://github.com/llvm/llvm-project/commit/15c1ab25ab85cb62a305664cc8b418a9b912bf4e
DIFF: https://github.com/llvm/llvm-project/commit/15c1ab25ab85cb62a305664cc8b418a9b912bf4e.diff
LOG: [Attributes] Remove special SRet/ByVal attribute handling in C API
Proper construction functions for these have long since been
exposed, and these attributes require a type nowadays, so drop the
old compatibility code.
Added:
Modified:
llvm/lib/IR/Core.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 8268caa951f06..b267f8288b690 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -147,18 +147,6 @@ LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
uint64_t Val) {
auto &Ctx = *unwrap(C);
auto AttrKind = (Attribute::AttrKind)KindID;
-
- if (AttrKind == Attribute::AttrKind::ByVal) {
- // After r362128, byval attributes need to have a type attribute. Provide a
- // NULL one until a proper API is added for this.
- return wrap(Attribute::getWithByValType(Ctx, nullptr));
- }
-
- if (AttrKind == Attribute::AttrKind::StructRet) {
- // Same as byval.
- return wrap(Attribute::getWithStructRetType(Ctx, nullptr));
- }
-
return wrap(Attribute::get(Ctx, AttrKind, Val));
}
More information about the llvm-commits
mailing list