mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[ABI/IRGen] Add custom function parameter flags representation for metadata use"
This reverts commit f6b0d2d2cf.
This commit is contained in:
@@ -758,19 +758,12 @@ namespace {
|
||||
flagsVal.getIntValue());
|
||||
|
||||
auto collectParameters =
|
||||
[&](llvm::function_ref<void(unsigned, llvm::Value *,
|
||||
ParameterFlags flags)>
|
||||
[&](llvm::function_ref<void(unsigned, llvm::Value *, uint8_t)>
|
||||
processor) {
|
||||
for (auto index : indices(params)) {
|
||||
auto param = params[index];
|
||||
auto flags = param.getParameterFlags();
|
||||
|
||||
auto parameterFlags = ParameterFlags()
|
||||
.withInOut(flags.isInOut())
|
||||
.withShared(flags.isShared())
|
||||
.withVariadic(flags.isVariadic());
|
||||
|
||||
processor(index, getFunctionParameterRef(param), parameterFlags);
|
||||
processor(index, getFunctionParameterRef(param), flags.toRaw());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -779,12 +772,10 @@ namespace {
|
||||
-> llvm::Constant * {
|
||||
arguments.push_back(flags);
|
||||
|
||||
collectParameters([&](unsigned i, llvm::Value *typeRef,
|
||||
ParameterFlags flags) {
|
||||
collectParameters([&](unsigned i, llvm::Value *typeRef, uint8_t flags) {
|
||||
arguments.push_back(typeRef);
|
||||
if (hasFlags)
|
||||
arguments.push_back(
|
||||
llvm::ConstantInt::get(IGF.IGM.Int32Ty, flags.getIntValue()));
|
||||
arguments.push_back(llvm::ConstantInt::get(IGF.IGM.Int32Ty, flags));
|
||||
});
|
||||
|
||||
arguments.push_back(result);
|
||||
@@ -841,12 +832,12 @@ namespace {
|
||||
ConstantInitBuilder paramFlags(IGF.IGM);
|
||||
auto flagsArr = paramFlags.beginArray();
|
||||
collectParameters([&](unsigned i, llvm::Value *typeRef,
|
||||
ParameterFlags flags) {
|
||||
uint8_t flags) {
|
||||
auto argPtr = IGF.Builder.CreateStructGEP(parameters, i,
|
||||
IGF.IGM.getPointerSize());
|
||||
IGF.Builder.CreateStore(typeRef, argPtr);
|
||||
if (hasFlags)
|
||||
flagsArr.addInt32(flags.getIntValue());
|
||||
flagsArr.addInt32(flags);
|
||||
});
|
||||
|
||||
auto parametersPtr =
|
||||
|
||||
Reference in New Issue
Block a user