Guard print() functions only used by dump() functions.

Summary:
Since  r293359, most dump() function are only defined when
`!defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` holds. print() functions
only used by dump() functions are now unused in release builds,
generating lots of warnings. This patch only defines some print()
functions if they are used.

Reviewers: MatzeB

Reviewed By: MatzeB

Subscribers: arsenm, mzolotukhin, nhaehnle, llvm-commits

Differential Revision: https://reviews.llvm.org/D35949

llvm-svn: 309553
This commit is contained in:
Florian Hahn
2017-07-31 10:07:49 +00:00
parent b4b4c0ae17
commit 6b3216aad8
10 changed files with 23 additions and 7 deletions

View File

@@ -365,6 +365,7 @@ static void printExtendedName(raw_ostream &OS, const DILocalVariable *V,
}
}
#ifndef NDEBUG
void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
auto *DV = cast<DILocalVariable>(Variable);
OS << "!\"";
@@ -390,6 +391,7 @@ void LDVImpl::print(raw_ostream &OS) {
for (unsigned i = 0, e = userValues.size(); i != e; ++i)
userValues[i]->print(OS, TRI);
}
#endif
void UserValue::coalesceLocation(unsigned LocNo) {
unsigned KeepLoc = 0;