mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Handle indirect returns in @objc methods properly.
Use CodeGenABITypes to determine which return values should be indirect in @objc methods. Swift SVN r11184
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "swift/AST/Diagnostics.h"
|
||||
#include "swift/ClangImporter/ClangImporter.h"
|
||||
#include "swift/IRGen/Options.h"
|
||||
#include "clang/CodeGen/CodeGenABITypes.h"
|
||||
#include "llvm/IR/Constants.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/IR/DerivedTypes.h"
|
||||
@@ -37,6 +38,7 @@
|
||||
|
||||
using namespace swift;
|
||||
using namespace irgen;
|
||||
using clang::CodeGen::CodeGenABITypes;
|
||||
using llvm::Attribute;
|
||||
|
||||
const unsigned DefaultAS = 0;
|
||||
@@ -199,9 +201,13 @@ IRGenModule::IRGenModule(ASTContext &Context,
|
||||
// TODO: use "tinycc" on platforms that support it
|
||||
RuntimeCC = llvm::CallingConv::C;
|
||||
|
||||
auto CI = static_cast<ClangImporter*>(&*Context.getClangModuleLoader());
|
||||
assert(CI && "no clang module loader");
|
||||
|
||||
auto &clangASTContext = CI->getClangASTContext();
|
||||
ABITypes = new CodeGenABITypes(clangASTContext, Module, DataLayout);
|
||||
|
||||
if (Opts.DebugInfo) {
|
||||
auto CI = static_cast<ClangImporter*>(&*Context.getClangModuleLoader());
|
||||
assert(CI && "no clang module loader");
|
||||
DebugInfo = new IRGenDebugInfo(Opts, *CI, *this, Module);
|
||||
}
|
||||
}
|
||||
@@ -210,6 +216,7 @@ IRGenModule::~IRGenModule() {
|
||||
delete &Types;
|
||||
if (DebugInfo)
|
||||
delete DebugInfo;
|
||||
delete ABITypes;
|
||||
}
|
||||
|
||||
static llvm::Constant *getRuntimeFn(IRGenModule &IGM,
|
||||
|
||||
Reference in New Issue
Block a user