[llvm] r340867 - Revert "[libFuzzer] Port to Windows"

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 12:07:26 PDT 2018


Author: morehouse
Date: Tue Aug 28 12:07:24 2018
New Revision: 340867

URL: http://llvm.org/viewvc/llvm-project?rev=340867&view=rev
Log:
Revert "[libFuzzer] Port to Windows"

This reverts commit r340860 due to failing tests.

Removed:
    llvm/trunk/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll
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=340867&r1=340866&r2=340867&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp Tue Aug 28 12:07:24 2018
@@ -273,15 +273,9 @@ Function *SanitizerCoverageModule::Creat
   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::runOnModul
     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::InjectCove
 
 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;

Removed: llvm/trunk/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll?rev=340866&view=auto
==============================================================================
--- llvm/trunk/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll (original)
+++ llvm/trunk/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll (removed)
@@ -1,12 +0,0 @@
-; Checks that the PC and 8-bit Counter Arrays are placed in their own sections in COFF binaries.
-; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-inline-8bit-counters=1 -sanitizer-coverage-pc-table=1 -S | FileCheck %s
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-pc-windows-msvc19.14.26433"
-
-define void @foo() {
-entry:
-  ret void
-}
-
-; CHECK-DAG: section ".SCOV{{\$}}CM",
-; CHECK-DAG: section ".SCOVP{{\$}}M",




More information about the llvm-commits mailing list