aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-22 17:17:27 +0000
committerChris Lattner <sabre@nondot.org>2002-05-22 17:17:27 +0000
commitf016ea4ff80c56c467247a90567dd07bddb590f3 (patch)
tree83ccc99063e91b0f13ad44491575a52378fa0cb5 /lib/Transforms/Scalar/IndVarSimplify.cpp
parent70e60cbd4dd59b61e3e9d0a55f24cf92b0dc8724 (diff)
Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 7b1eb5d732..644652691e 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -8,6 +8,7 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Analysis/InductionVariable.h"
#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Analysis/Writer.h"
#include "llvm/iPHINode.h"
#include "llvm/iOther.h"
#include "llvm/Type.h"
@@ -19,10 +20,6 @@
static Statistic<> NumRemoved ("indvars\t\t- Number of aux indvars removed");
static Statistic<> NumInserted("indvars\t\t- Number of cannonical indvars added");
-#if 0
-#define DEBUG
-#include "llvm/Analysis/Writer.h"
-#endif
// InsertCast - Cast Val to Ty, setting a useful name on the cast if Val has a
// name...
@@ -116,9 +113,7 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
Changed = true;
}
-#ifdef DEBUG
- cerr << "Induction variables:\n";
-#endif
+ DEBUG(cerr << "Induction variables:\n");
// Get the current loop iteration count, which is always the value of the
// cannonical phi node...
@@ -131,9 +126,9 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
unsigned InsertPos = IndVars.size();
for (unsigned i = 0; i < IndVars.size(); ++i) {
InductionVariable *IV = &IndVars[i];
-#ifdef DEBUG
- cerr << IndVars[i];
-#endif
+
+ DEBUG(cerr << IV);
+
// Don't modify the cannonical indvar or unrecognized indvars...
if (IV != Cannonical && IV->InductionType != InductionVariable::Unknown) {
Instruction *Val = IterCount;