[llvm] df2ea2f - [ConstriantElimination] Add NODEBUG condition around `dump`
Zain Jaffal via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 10:53:40 PST 2023
Author: Zain Jaffal
Date: 2023-02-15T18:53:22Z
New Revision: df2ea2fc2839f975d67cb89020e62f5a95c677a2
URL: https://github.com/llvm/llvm-project/commit/df2ea2fc2839f975d67cb89020e62f5a95c677a2
DIFF: https://github.com/llvm/llvm-project/commit/df2ea2fc2839f975d67cb89020e62f5a95c677a2.diff
LOG: [ConstriantElimination] Add NODEBUG condition around `dump`
Added:
Modified:
llvm/lib/Analysis/ConstraintSystem.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ConstraintSystem.cpp b/llvm/lib/Analysis/ConstraintSystem.cpp
index 9a8897ecbd43..102fcc623e06 100644
--- a/llvm/lib/Analysis/ConstraintSystem.cpp
+++ b/llvm/lib/Analysis/ConstraintSystem.cpp
@@ -114,6 +114,7 @@ bool ConstraintSystem::mayHaveSolutionImpl() {
SmallVector<std::string> ConstraintSystem::getVarNamesList() const {
SmallVector<std::string> Names(Value2Index.size(), "");
+#ifndef NDEBUG
for (auto &[V, Index] : Value2Index) {
std::string OperandName;
if (V->getName().empty())
@@ -122,10 +123,12 @@ SmallVector<std::string> ConstraintSystem::getVarNamesList() const {
OperandName = std::string("%") + V->getName().str();
Names[Index - 1] = OperandName;
}
+#endif
return Names;
}
void ConstraintSystem::dump() const {
+#ifndef NDEBUG
if (Constraints.empty())
return;
SmallVector<std::string> Names = getVarNamesList();
@@ -143,6 +146,7 @@ void ConstraintSystem::dump() const {
LLVM_DEBUG(dbgs() << join(Parts, std::string(" + "))
<< " <= " << std::to_string(Row[0]) << "\n");
}
+#endif
}
bool ConstraintSystem::mayHaveSolution() {
More information about the llvm-commits
mailing list