From ac075b1ae95535f0955086f73e4e75c5189f3708 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 20 Feb 2015 13:15:49 +0000 Subject: [PATCH] Wrap recursive function only used in assert in #ifndef NDEBUG. Avoids unused function warnings in Release builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230009 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 3c517ee2fa3..0b5e297c9ee 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/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(Ty)) return isGCPointerType(VT->getScalarType()); @@ -155,11 +157,13 @@ static bool isAggWhichContainsGCPtrType(Type *Ty) { } else if (StructType *ST = dyn_cast(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 -- 2.34.1