aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2018-09-04 18:10:54 +0000
committerHiroshi Yamauchi <yamauchi@google.com>2018-09-04 18:10:54 +0000
commit72ee6d60003e78c84a1532618a86b997c805151f (patch)
treebe91881164c66c850a62c9b1f8dbae9e182ad335 /llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
parent88f72854157486050a8f1e46151369e48d10b4f5 (diff)
downloadllvm-72ee6d60003e78c84a1532618a86b997c805151f.zip
llvm-72ee6d60003e78c84a1532618a86b997c805151f.tar.gz
llvm-72ee6d60003e78c84a1532618a86b997c805151f.tar.bz2
Fix build failures after rL341386.
Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51647 llvm-svn: 341391
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
index 4d925c8..2e01047 100644
--- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -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, ProfileSummaryInfo& PSI) {
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 char *Label, CHRStats *Stats) {
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 assertBranchOrSelectConditionHoisted(CHRScope *Scope,
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 assertBranchOrSelectConditionHoisted(CHRScope *Scope,
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");