Skip to content

Commit

Permalink
Merge pull request #21158 from compnerd/windows-enum
Browse files Browse the repository at this point in the history
IRGen: address TODO for COMDATing
  • Loading branch information
compnerd committed Dec 9, 2018
2 parents 639ea2c + f067cb7 commit 71c11b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/IRGen/GenDecl.cpp
Expand Up @@ -1594,9 +1594,6 @@ llvm::Function *irgen::createFunction(IRGenModule &IGM,

llvm::Function *fn =
llvm::Function::Create(signature.getType(), linkInfo.getLinkage(), name);
// TODO(compnerd) apply COMDAT to definitions
fn->setVisibility(linkInfo.getVisibility());
fn->setDLLStorageClass(linkInfo.getDLLStorage());
fn->setCallingConv(signature.getCallingConv());

if (insertBefore) {
Expand All @@ -1605,6 +1602,9 @@ llvm::Function *irgen::createFunction(IRGenModule &IGM,
IGM.Module.getFunctionList().push_back(fn);
}

ApplyIRLinkage({linkInfo.getLinkage(), linkInfo.getVisibility(), linkInfo.getDLLStorage()})
.to(fn);

llvm::AttrBuilder initialAttrs;
IGM.constructInitialFnAttributes(initialAttrs, FuncOptMode);
// Merge initialAttrs with attrs.
Expand Down

0 comments on commit 71c11b7

Please sign in to comment.