[llvm] r230009 - Wrap recursive function only used in assert in #ifndef NDEBUG.
Benjamin Kramer
benny.kra at googlemail.com
Fri Feb 20 05:15:49 PST 2015
Author: d0k
Date: Fri Feb 20 07:15:49 2015
New Revision: 230009
URL: http://llvm.org/viewvc/llvm-project?rev=230009&view=rev
Log:
Wrap recursive function only used in assert in #ifndef NDEBUG.
Avoids unused function warnings in Release builds.
Modified:
llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=230009&r1=230008&r2=230009&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Fri Feb 20 07:15:49 2015
@@ -146,6 +146,8 @@ static bool isLiveGCReferenceAt(Value &V
// 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(
} 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
More information about the llvm-commits
mailing list