diff options
author | Matt Morehouse <mascasa@google.com> | 2018-08-28 19:07:24 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-08-28 19:07:24 +0000 |
commit | bab8556f01b36f519f3f7bd9f616cab17a5bf862 (patch) | |
tree | 00c47d724c2e95064360d3dbf945a87ef17a1b21 /llvm/lib/Transforms | |
parent | 755f41f3a2125d3ef56dfe2cb0997ae7243785c5 (diff) | |
download | bcm5719-llvm-bab8556f01b36f519f3f7bd9f616cab17a5bf862.tar.gz bcm5719-llvm-bab8556f01b36f519f3f7bd9f616cab17a5bf862.zip |
Revert "[libFuzzer] Port to Windows"
This reverts commit r340860 due to failing tests.
llvm-svn: 340867
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 6a3ae2d9d33..c0b219d1d1b 100644 --- a/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -273,15 +273,9 @@ Function *SanitizerCoverageModule::CreateInitCallsForSections( auto SecStart = SecStartEnd.first; auto SecEnd = SecStartEnd.second; Function *CtorFunc; - auto SecStartPtr = IRB.CreatePointerCast(SecStart, Ty); - // 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) - SecStartPtr = IRB.CreateAdd(SecStartPtr, - ConstantInt::get(IntptrTy, sizeof(uint64_t))); 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. @@ -403,15 +397,9 @@ bool SanitizerCoverageModule::runOnModule(Module &M) { Function *InitFunction = declareSanitizerInitFunction( M, SanCovPCsInitName, {IntptrPtrTy, IntptrPtrTy}); IRBuilder<> IRBCtor(Ctor->getEntryBlock().getTerminator()); - auto SecStartPtr = IRB.CreatePointerCast(SecStartEnd.first, IntptrPtrTy); - // 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) - SecStartPtr = IRB.CreateAdd(SecStartPtr, - ConstantInt::get(IntptrTy, sizeof(uint64_t))); - 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. @@ -821,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; |