[llvm-commits] [llvm] r163900 - /llvm/trunk/lib/Transforms/Scalar/SROA.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Sep 14 06:08:09 PDT 2012


Author: d0k
Date: Fri Sep 14 08:08:09 2012
New Revision: 163900

URL: http://llvm.org/viewvc/llvm-project?rev=163900&view=rev
Log:
SROA: Silence unused variable warnings in Release builds.

The NDEBUG hack is ugly, but I see no better solution.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SROA.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=163900&r1=163899&r2=163900&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Fri Sep 14 08:08:09 2012
@@ -303,8 +303,10 @@
   class UseBuilder;
   friend class AllocaPartitioning::UseBuilder;
 
+#ifndef NDEBUG
   /// \brief Handle to alloca instruction to simplify method interfaces.
   AllocaInst &AI;
+#endif
 
   /// \brief The instruction responsible for this alloca having no partitioning.
   ///
@@ -988,7 +990,11 @@
 }
 
 AllocaPartitioning::AllocaPartitioning(const TargetData &TD, AllocaInst &AI)
-    : AI(AI), PointerEscapingInstr(0) {
+    :
+#ifndef NDEBUG
+      AI(AI),
+#endif
+      PointerEscapingInstr(0) {
   PartitionBuilder PB(TD, AI, *this);
   if (!PB())
     return;
@@ -1906,6 +1912,7 @@
       uint64_t OrigEnd = IsDest ? MTO.DestEnd : MTO.SourceEnd;
       // Ensure the start lines up.
       assert(BeginOffset == OrigBegin);
+      (void)OrigBegin;
 
       // Rewrite the size as needed.
       if (EndOffset != OrigEnd)





More information about the llvm-commits mailing list