forked from OSchip/llvm-project
ADT::GenericCycleInfo: Hide validateTree() in -Asserts.
validateTree() is instantiated with __FILE__. It will be pruned at link time due to -ffunction-sections but be left in object files. Its user is only GenericCycleInfo::compute() with assert(validateTree()); Therefore I think validateTree() may be hidden with NDEBUG. This is a fixup for https://reviews.llvm.org/D112696
This commit is contained in:
parent
cba0ebd576
commit
cd5f3241c3
|
@ -326,6 +326,7 @@ auto GenericCycleInfo<ContextT>::getCycle(const BlockT *Block) const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
/// \brief Validate the internal consistency of the cycle tree.
|
||||
///
|
||||
/// Note that this does \em not check that cycles are really cycles in the CFG,
|
||||
|
@ -391,6 +392,7 @@ bool GenericCycleInfo<ContextT>::validateTree() const {
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// \brief Print the cycle info.
|
||||
template <typename ContextT>
|
||||
|
|
|
@ -249,7 +249,9 @@ public:
|
|||
|
||||
/// Methods for debug and self-test.
|
||||
//@{
|
||||
#ifndef NDEBUG
|
||||
bool validateTree() const;
|
||||
#endif
|
||||
void print(raw_ostream &Out) const;
|
||||
void dump() const { print(dbgs()); }
|
||||
//@}
|
||||
|
|
Loading…
Reference in New Issue