summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-13 21:51:15 +0000
committerDan Gohman <gohman@apple.com>2009-07-13 21:51:15 +0000
commitc8d76d5afb023a1c6b439941be3b62789fcc0ed3 (patch)
tree0ff6a38e33cf421026ea0232d6c47ed6f27d554d /lib
parent92aa0bb4cab8dec9df4c51b414b5861953752a32 (diff)
downloadllvm-c8d76d5afb023a1c6b439941be3b62789fcc0ed3.tar.gz
llvm-c8d76d5afb023a1c6b439941be3b62789fcc0ed3.tar.bz2
llvm-c8d76d5afb023a1c6b439941be3b62789fcc0ed3.tar.xz
Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75519 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/IVUsers.cpp2
-rw-r--r--lib/CodeGen/MachineLoopInfo.cpp8
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp2
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp
index 317c869164..9ad7cc9e5d 100644
--- a/lib/Analysis/IVUsers.cpp
+++ b/lib/Analysis/IVUsers.cpp
@@ -54,7 +54,7 @@ static bool containsAddRecFromDifferentLoop(const SCEV *S, Loop *L) {
if (newLoop == L)
return false;
// if newLoop is an outer loop of L, this is OK.
- if (!LoopInfoBase<BasicBlock>::isNotAlreadyContainedIn(L, newLoop))
+ if (!LoopInfo::isNotAlreadyContainedIn(L, newLoop))
return false;
}
return true;
diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp
index ff56f4de59..a5694ae82b 100644
--- a/lib/CodeGen/MachineLoopInfo.cpp
+++ b/lib/CodeGen/MachineLoopInfo.cpp
@@ -19,8 +19,12 @@
#include "llvm/CodeGen/Passes.h"
using namespace llvm;
-TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
-TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
+#define MLB class LoopBase<MachineBasicBlock, MachineLoop>
+TEMPLATE_INSTANTIATION(MLB);
+#undef MLB
+#define MLIB class LoopInfoBase<MachineBasicBlock, MachineLoop>
+TEMPLATE_INSTANTIATION(MLIB);
+#undef MLIB
char MachineLoopInfo::ID = 0;
static RegisterPass<MachineLoopInfo>
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 454cc93d31..a1781c9858 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -248,7 +248,7 @@ static bool containsAddRecFromDifferentLoop(const SCEV *S, Loop *L) {
if (newLoop == L)
return false;
// if newLoop is an outer loop of L, this is OK.
- if (!LoopInfoBase<BasicBlock>::isNotAlreadyContainedIn(L, newLoop))
+ if (!LoopInfo::isNotAlreadyContainedIn(L, newLoop))
return false;
}
return true;