[RS4GC] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build after D125000
authorFangrui Song <i@maskray.me>
Sat, 14 May 2022 17:47:50 +0000 (10:47 -0700)
committerFangrui Song <i@maskray.me>
Sat, 14 May 2022 17:47:50 +0000 (10:47 -0700)
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

index 3c1ccc0..85dc56c 100644 (file)
@@ -396,10 +396,6 @@ static void analyzeParsePointLiveness(
   Result.LiveSet = LiveSet;
 }
 
-// Returns true if V is a BaseResult that already exists in the IR, i.e. it is
-// not created by the findBasePointers algorithm.
-static bool isOriginalBaseResult(Value *V);
-
 /// Returns true if V is a known base.
 static bool isKnownBase(Value *V, const IsKnownBaseMapTy &KnownBases);
 
@@ -713,6 +709,7 @@ static Value *findBaseOrBDV(Value *I, DefiningValueMapTy &Cache,
   return Def;
 }
 
+#ifndef NDEBUG
 /// This value is a base pointer that is not generated by RS4GC, i.e. it already
 /// exists in the code.
 static bool isOriginalBaseResult(Value *V) {
@@ -721,6 +718,7 @@ static bool isOriginalBaseResult(Value *V) {
          !isa<ExtractElementInst>(V) && !isa<InsertElementInst>(V) &&
          !isa<ShuffleVectorInst>(V);
 }
+#endif
 
 static bool isKnownBase(Value *V, const IsKnownBaseMapTy &KnownBases) {
   auto It = KnownBases.find(V);