[globalisel] Fix an unused variable warning when NDEBUG is defined.
authorDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 20 Jan 2017 21:40:05 +0000 (21:40 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Fri, 20 Jan 2017 21:40:05 +0000 (21:40 +0000)
llvm-svn: 292653

llvm/utils/TableGen/RegisterBankEmitter.cpp

index 066650a..816fc3e 100644 (file)
@@ -256,8 +256,8 @@ void RegisterBankEmitter::emitBaseClassImplementation(
      << "    : RegisterBankInfo(RegBanks, " << TargetName
      << "::NumRegisterBanks) {\n"
      << "  // Assert that RegBank indices match their ID's\n"
-     << "  unsigned Index = 0;\n"
      << "#ifndef NDEBUG\n"
+     << "  unsigned Index = 0;\n"
      << "  for (const auto &RB : RegBanks)\n"
      << "    assert(Index++ == RB->getID() && \"Index != ID\");\n"
      << "#endif // NDEBUG\n"