[llvm] r341391 - Fix build failures after rL341386.

Hiroshi Yamauchi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 11:10:54 PDT 2018


Author: yamauchi
Date: Tue Sep  4 11:10:54 2018
New Revision: 341391

URL: http://llvm.org/viewvc/llvm-project?rev=341391&view=rev
Log:
Fix build failures after rL341386.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51647

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp?rev=341391&r1=341390&r2=341391&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp Tue Sep  4 11:10:54 2018
@@ -34,7 +34,9 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Transforms/Scalar.h"
 
+#if !defined(_MSC_VER)
 #include <cxxabi.h>
+#endif
 #include <set>
 #include <sstream>
 
@@ -446,8 +448,10 @@ static bool shouldApply(Function &F, Pro
       return true;
     const char* DemangledName = nullptr;
     int Status = -1;
+#if !defined(_MSC_VER)
     DemangledName = abi::__cxa_demangle(Name.str().c_str(),
                                         nullptr, nullptr, &Status);
+#endif
     return DemangledName && CHRFunctions.count(DemangledName);
   }
 
@@ -459,8 +463,10 @@ static void dumpIR(Function &F, const ch
   std::string Name = F.getName().str();
   const char *DemangledName = nullptr;
   int Status = -1;
+#if !defined(_MSC_VER)
   DemangledName = abi::__cxa_demangle(Name.c_str(),
                                       nullptr, nullptr, &Status);
+#endif
   if (DemangledName == nullptr) {
     DemangledName = "<NOT-MANGLED>";
   }
@@ -1593,6 +1599,7 @@ static void assertBranchOrSelectConditio
       Value *V = BI->getCondition();
       CHR_DEBUG(dbgs() << *V << "\n");
       if (auto *I = dyn_cast<Instruction>(V)) {
+        (void)(I); // Unused in release build.
         assert((I->getParent() == PreEntryBlock ||
                 !Scope->contains(I)) &&
                "Must have been hoisted to PreEntryBlock or outside the scope");
@@ -1606,6 +1613,7 @@ static void assertBranchOrSelectConditio
       Value *V = SI->getCondition();
       CHR_DEBUG(dbgs() << *V << "\n");
       if (auto *I = dyn_cast<Instruction>(V)) {
+        (void)(I); // Unused in release build.
         assert((I->getParent() == PreEntryBlock ||
                 !Scope->contains(I)) &&
                "Must have been hoisted to PreEntryBlock or outside the scope");




More information about the llvm-commits mailing list