summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2018-08-29 18:40:41 +0000
committerMatt Morehouse <mascasa@google.com>2018-08-29 18:40:41 +0000
commitcf311cfc20a363ba1ee1a8115ab307d6745a6b73 (patch)
treeb08c29bb56ec4cd15a376d479731e5c5ef9ec4e8 /llvm/lib/Transforms/Instrumentation
parent8d8e1235abf72375b77ff7ad1e3b56dce32d23c0 (diff)
downloadbcm5719-llvm-cf311cfc20a363ba1ee1a8115ab307d6745a6b73.tar.gz
bcm5719-llvm-cf311cfc20a363ba1ee1a8115ab307d6745a6b73.zip
Revert "[libFuzzer] Port to Windows"
This reverts r340949 due to bot breakage again. llvm-svn: 340954
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp39
1 files changed, 6 insertions, 33 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
index 1f97e909851..c0b219d1d1b 100644
--- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
@@ -273,20 +273,9 @@ Function *SanitizerCoverageModule::CreateInitCallsForSections(
auto SecStart = SecStartEnd.first;
auto SecEnd = SecStartEnd.second;
Function *CtorFunc;
- Value *SecStartPtr = nullptr;
- // Account for the fact that on windows-msvc __start_* symbols actually
- // point to a uint64_t before the start of the array.
- if (TargetTriple.getObjectFormat() == Triple::COFF) {
- auto SecStartI8Ptr = IRB.CreatePointerCast(SecStart, Int8PtrTy);
- auto GEP = IRB.CreateGEP(SecStartI8Ptr,
- ConstantInt::get(IntptrTy, sizeof(uint64_t)));
- SecStartPtr = IRB.CreatePointerCast(GEP, Ty);
- } else {
- SecStartPtr = IRB.CreatePointerCast(SecStart, Ty);
- }
std::tie(CtorFunc, std::ignore) = createSanitizerCtorAndInitFunctions(
M, SanCovModuleCtorName, InitFunctionName, {Ty, Ty},
- {SecStartPtr, IRB.CreatePointerCast(SecEnd, Ty)});
+ {IRB.CreatePointerCast(SecStart, Ty), IRB.CreatePointerCast(SecEnd, Ty)});
if (TargetTriple.supportsCOMDAT()) {
// Use comdat to dedup CtorFunc.
@@ -408,20 +397,9 @@ bool SanitizerCoverageModule::runOnModule(Module &M) {
Function *InitFunction = declareSanitizerInitFunction(
M, SanCovPCsInitName, {IntptrPtrTy, IntptrPtrTy});
IRBuilder<> IRBCtor(Ctor->getEntryBlock().getTerminator());
- Value *SecStartPtr = nullptr;
- // Account for the fact that on windows-msvc __start_pc_table actually
- // points to a uint64_t before the start of the PC table.
- if (TargetTriple.getObjectFormat() == Triple::COFF) {
- auto SecStartI8Ptr = IRB.CreatePointerCast(SecStartEnd.first, Int8PtrTy);
- auto GEP = IRB.CreateGEP(SecStartI8Ptr,
- ConstantInt::get(IntptrTy, sizeof(uint64_t)));
- SecStartPtr = IRB.CreatePointerCast(GEP, IntptrPtrTy);
- } else {
- SecStartPtr = IRB.CreatePointerCast(SecStartEnd.first, IntptrPtrTy);
- }
- IRBCtor.CreateCall(
- InitFunction,
- {SecStartPtr, IRB.CreatePointerCast(SecStartEnd.second, IntptrPtrTy)});
+ IRBCtor.CreateCall(InitFunction,
+ {IRB.CreatePointerCast(SecStartEnd.first, IntptrPtrTy),
+ IRB.CreatePointerCast(SecStartEnd.second, IntptrPtrTy)});
}
// We don't reference these arrays directly in any of our runtime functions,
// so we need to prevent them from being dead stripped.
@@ -831,13 +809,8 @@ void SanitizerCoverageModule::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
std::string
SanitizerCoverageModule::getSectionName(const std::string &Section) const {
- if (TargetTriple.getObjectFormat() == Triple::COFF) {
- if (Section == SanCovCountersSectionName)
- return ".SCOV$CM";
- if (Section == SanCovPCsSectionName)
- return ".SCOVP$M";
- return ".SCOV$GM"; // For SanCovGuardsSectionName.
- }
+ if (TargetTriple.getObjectFormat() == Triple::COFF)
+ return ".SCOV$M";
if (TargetTriple.isOSBinFormatMachO())
return "__DATA,__" + Section;
return "__" + Section;
OpenPOWER on IntegriCloud