Skip to content

Commit 162fa4d

Browse files
authored
Module::getOrInsertFunction: set debug info format (#82505)
Function::Function's constructor sets the debug info format based on the passed in parent Module, so by using this rather than modifying the function list directly, we pick up the debug info format automatically.
1 parent 2e29c91 commit 162fa4d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/IR/Module.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
149149
if (!F) {
150150
// Nope, add it
151151
Function *New = Function::Create(Ty, GlobalVariable::ExternalLinkage,
152-
DL.getProgramAddressSpace(), Name);
152+
DL.getProgramAddressSpace(), Name, this);
153153
if (!New->isIntrinsic()) // Intrinsics get attrs set on construction
154154
New->setAttributes(AttributeList);
155-
FunctionList.push_back(New);
156155
return {Ty, New}; // Return the new prototype.
157156
}
158157

0 commit comments

Comments
 (0)