Skip to content

Commit 80732ea

Browse files
committed
Non-witness implementations of init_existential_addr, deinit_existential_addr, open_existential_addr, copy_addr, destory_addr
For the boxed existential variant.
1 parent 5210258 commit 80732ea

File tree

11 files changed

+1581
-25
lines changed

11 files changed

+1581
-25
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,7 +3328,8 @@ IRGenModule::getAddrOfAssociatedTypeWitnessTableAccessFunction(
33283328

33293329
/// Should we be defining the given helper function?
33303330
static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
3331-
llvm::Constant *fn) {
3331+
llvm::Constant *fn,
3332+
bool setIsNoInline) {
33323333
llvm::Function *def = dyn_cast<llvm::Function>(fn);
33333334
if (!def) return nullptr;
33343335
if (!def->empty()) return nullptr;
@@ -3338,6 +3339,8 @@ static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
33383339
def->setDLLStorageClass(llvm::GlobalVariable::DefaultStorageClass);
33393340
def->setDoesNotThrow();
33403341
def->setCallingConv(IGM.DefaultCC);
3342+
if(setIsNoInline)
3343+
def->addFnAttr(llvm::Attribute::NoInline);
33413344
return def;
33423345
}
33433346

@@ -3352,13 +3355,14 @@ static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
33523355
llvm::Constant *
33533356
IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
33543357
ArrayRef<llvm::Type*> paramTys,
3355-
llvm::function_ref<void(IRGenFunction &IGF)> generate) {
3358+
llvm::function_ref<void(IRGenFunction &IGF)> generate,
3359+
bool setIsNoInline) {
33563360
llvm::FunctionType *fnTy =
33573361
llvm::FunctionType::get(resultTy, paramTys, false);
33583362

33593363
llvm::Constant *fn = Module.getOrInsertFunction(fnName, fnTy);
33603364

3361-
if (llvm::Function *def = shouldDefineHelper(*this, fn)) {
3365+
if (llvm::Function *def = shouldDefineHelper(*this, fn, setIsNoInline)) {
33623366
IRGenFunction IGF(*this, def);
33633367
if (DebugInfo)
33643368
DebugInfo->emitArtificialFunction(IGF, def);

0 commit comments

Comments
 (0)