Skip to content

Commit 511050e

Browse files
committed
[NFC] IRGen: Lift this function from IGF to IGM.
1 parent b4134e1 commit 511050e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/IRGen/GenPointerAuth.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,10 @@ void ConstantAggregateBuilderBase::addSignedPointer(llvm::Constant *pointer,
771771
llvm::ConstantInt::get(IGM().Int64Ty, otherDiscriminator));
772772
}
773773

774+
llvm::ConstantInt *IRGenModule::getMallocTypeId(llvm::Function *fn) {
775+
return getDiscriminatorForString(*this, fn->getName());
776+
}
777+
774778
llvm::ConstantInt* IRGenFunction::getMallocTypeId() {
775-
return getDiscriminatorForString(IGM, CurFn->getName());
779+
return IGM.getMallocTypeId(CurFn);
776780
}

lib/IRGen/IRGenModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,8 @@ private: \
16741674
llvm::AttributeList constructInitialAttributes();
16751675
StackProtectorMode shouldEmitStackProtector(SILFunction *f);
16761676

1677+
llvm::ConstantInt *getMallocTypeId(llvm::Function *fn);
1678+
16771679
void emitProtocolDecl(ProtocolDecl *D);
16781680
void emitEnumDecl(EnumDecl *D);
16791681
void emitStructDecl(StructDecl *D);

0 commit comments

Comments
 (0)