Roll variables into an LLVM_DEBUG block to address -Wunused-but-set-variable

This commit is contained in:
David Blaikie 2020-05-26 12:04:14 -07:00
parent 713538b629
commit fca76b7945
1 changed files with 2 additions and 6 deletions

View File

@ -83,8 +83,6 @@ private:
for (auto SymRef : *Symbols) {
Optional<StringRef> Name;
unsigned char Binding;
uint64_t Value;
uint64_t Size = 0;
// FIXME: Read size.
@ -95,17 +93,15 @@ private:
} else {
return NameOrErr.takeError();
}
Binding = SymRef.getBinding();
Value = SymRef.getValue();
LLVM_DEBUG({
dbgs() << " ";
if (!Name)
dbgs() << "<anonymous symbol>";
else
dbgs() << *Name;
dbgs() << ": value = " << formatv("{0:x16}", Value)
dbgs() << ": value = " << formatv("{0:x16}", SymRef.getValue())
<< ", type = " << formatv("{0:x2}", SymRef.getType())
<< ", binding = " << Binding
<< ", binding = " << SymRef.getBinding()
<< ", size =" << Size;
dbgs() << "\n";
});