summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-20 13:15:49 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-20 13:15:49 +0000
commitd4a3a555646b692f9a3b24346ad40e2025908deb (patch)
tree9dbfce51a155837c9c907d532b70a67072b5db90 /llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
parentc12d88dc8f129e0cf18119c9ba6391e9a82681cc (diff)
downloadbcm5719-llvm-d4a3a555646b692f9a3b24346ad40e2025908deb.tar.gz
bcm5719-llvm-d4a3a555646b692f9a3b24346ad40e2025908deb.zip
Wrap recursive function only used in assert in #ifndef NDEBUG.
Avoids unused function warnings in Release builds. llvm-svn: 230009
Diffstat (limited to 'llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 3c517ee2fa3..0b5e297c9ee 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -146,6 +146,8 @@ static bool isLiveGCReferenceAt(Value &V, Instruction *loc, DominatorTree &DT,
// Given assumption that V dominates loc, this may be live
return true;
}
+
+#ifndef NDEBUG
static bool isAggWhichContainsGCPtrType(Type *Ty) {
if (VectorType *VT = dyn_cast<VectorType>(Ty))
return isGCPointerType(VT->getScalarType());
@@ -155,11 +157,13 @@ static bool isAggWhichContainsGCPtrType(Type *Ty) {
} else if (StructType *ST = dyn_cast<StructType>(Ty)) {
bool UnsupportedType = false;
for (Type *SubType : ST->subtypes())
- UnsupportedType |= isGCPointerType(SubType) || isAggWhichContainsGCPtrType(SubType);
+ UnsupportedType |=
+ isGCPointerType(SubType) || isAggWhichContainsGCPtrType(SubType);
return UnsupportedType;
} else
return false;
}
+#endif
// Conservatively identifies any definitions which might be live at the
// given instruction. The analysis is performed immediately before the
OpenPOWER on IntegriCloud