Skip to content

Commit f92d970

Browse files
committed
[llvm][SanitizerCoverage] Remove no-op 'ptr addrspace(0)' to 'ptr addrspace(0)' pointercast (NFC)
Opaque ptr cleanup effort.
1 parent a4e67de commit f92d970

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ ModuleSanitizerCoverage::CreateSecStartEnd(Module &M, const char *Section,
329329

330330
// Account for the fact that on windows-msvc __start_* symbols actually
331331
// point to a uint64_t before the start of the array.
332-
auto SecStartI8Ptr = IRB.CreatePointerCast(SecStart, PtrTy);
333-
auto GEP = IRB.CreateGEP(Int8Ty, SecStartI8Ptr,
332+
auto GEP = IRB.CreateGEP(Int8Ty, SecStart,
334333
ConstantInt::get(IntptrTy, sizeof(uint64_t)));
335334
return std::make_pair(GEP, SecEnd);
336335
}
@@ -838,8 +837,7 @@ void ModuleSanitizerCoverage::InjectTraceForSwitch(
838837
*CurModule, ArrayOfInt64Ty, false, GlobalVariable::InternalLinkage,
839838
ConstantArray::get(ArrayOfInt64Ty, Initializers),
840839
"__sancov_gen_cov_switch_values");
841-
IRB.CreateCall(SanCovTraceSwitchFunction,
842-
{Cond, IRB.CreatePointerCast(GV, PtrTy)});
840+
IRB.CreateCall(SanCovTraceSwitchFunction, {Cond, GV});
843841
}
844842
}
845843
}

0 commit comments

Comments
 (0)