[llvm] r309644 - [sanitizer-coverage] relax an assertion
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 17:44:05 PDT 2017
Author: kcc
Date: Mon Jul 31 17:44:05 2017
New Revision: 309644
URL: http://llvm.org/viewvc/llvm-project?rev=309644&view=rev
Log:
[sanitizer-coverage] relax an assertion
Modified:
llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp?rev=309644&r1=309643&r2=309644&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp Mon Jul 31 17:44:05 2017
@@ -499,12 +499,13 @@ void SanitizerCoverageModule::CreatePCAr
ArrayRef<BasicBlock *> AllBlocks) {
size_t N = AllBlocks.size();
assert(N);
- assert(&F.getEntryBlock() == AllBlocks[0]);
SmallVector<Constant *, 16> PCs;
IRBuilder<> IRB(&*F.getEntryBlock().getFirstInsertionPt());
- PCs.push_back((Constant *)IRB.CreatePointerCast(&F, Int8PtrTy));
- for (size_t i = 1; i < N; i++)
- PCs.push_back(BlockAddress::get(AllBlocks[i]));
+ for (size_t i = 0; i < N; i++)
+ if (&F.getEntryBlock() == AllBlocks[i])
+ PCs.push_back((Constant *)IRB.CreatePointerCast(&F, Int8PtrTy));
+ else
+ PCs.push_back(BlockAddress::get(AllBlocks[i]));
FunctionPCsArray =
CreateFunctionLocalArrayInSection(N, F, Int8PtrTy, SanCovPCsSectionName);
FunctionPCsArray->setInitializer(
More information about the llvm-commits
mailing list