[psuedo] Fix for unused warning by moving code into debug macro.

This commit is contained in:
Weverything 2022-05-03 15:13:17 -07:00
parent 3dd00461f9
commit 0e86cddf98
1 changed files with 7 additions and 6 deletions

View File

@ -90,12 +90,13 @@ const ForestNode &glrParse(const TokenStream &Tokens,
});
if (!PendingAccept.empty()) {
LLVM_DEBUG(llvm::dbgs() << llvm::formatv("Accept: {0} accepted result:\n",
PendingAccept.size()));
for (const auto &Accept : PendingAccept)
LLVM_DEBUG(llvm::dbgs()
<< " - " << G.symbolName(Accept.Head->Payload->symbol())
<< "\n");
LLVM_DEBUG({
llvm::dbgs() << llvm::formatv("Accept: {0} accepted result:\n",
PendingAccept.size());
for (const auto &Accept : PendingAccept)
llvm::dbgs() << " - " << G.symbolName(Accept.Head->Payload->symbol())
<< "\n";
});
assert(PendingAccept.size() == 1);
return *PendingAccept.front().Head->Payload;
}