Add a reference to the PC array in llvm.used so that linkers that
aggressively dead strip (like ld64) don't remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311742
91177308-0d34-0410-b5e6-
96231b3b80d8
FunctionPCsArray->setInitializer(
ConstantArray::get(ArrayType::get(Int8PtrTy, N), PCs));
FunctionPCsArray->setConstant(true);
+
+ // We don't reference the PCs array in any of our runtime functions, so we
+ // need to prevent it from being dead stripped.
+ appendToUsed(*F.getParent(), {FunctionPCsArray});
}
void SanitizerCoverageModule::CreateFunctionLocalArrays(