Skip to content

Commit a26d7b8

Browse files
committed
Add comment to weak linkage
1 parent 736ccf9 commit a26d7b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,10 @@ llvm::GlobalValue::LinkageTypes MicrosoftCXXABI::getCXXDestructorLinkage(
14131413
// is internal.
14141414
return llvm::GlobalValue::LinkOnceODRLinkage;
14151415
case Dtor_VectorDeleting:
1416+
// Use the weak, non-ODR linkage for vector deleting destructors to block
1417+
// inlining. This enables an MS ABI code-size saving optimization that
1418+
// allows us to avoid emitting array deletion code when arrays of a given
1419+
// type are not allocated within the final linkage unit.
14161420
return llvm::GlobalValue::WeakAnyLinkage;
14171421
case Dtor_Comdat:
14181422
llvm_unreachable("MS C++ ABI does not support comdat dtors");

0 commit comments

Comments
 (0)