SROA: Silence unused variable warnings in Release builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-09-14 13:08:09 +00:00
parent e5c4fe568e
commit d0807690de

View File

@ -303,8 +303,10 @@ private:
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 @@ void AllocaPartitioning::splitAndMergePartitions() {
}
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 @@ private:
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)