Prepare to move ClColoring from SafeStackCode to SafeStackLayout.
This will allow to reuse the code in other components.
}
#endif
-void StackColoring::run() {
+StackColoring::StackColoring(Function &F, ArrayRef<AllocaInst *> Allocas)
+ : F(F), Allocas(Allocas), NumAllocas(Allocas.size()) {
LLVM_DEBUG(dumpAllocas());
for (unsigned I = 0; I < NumAllocas; ++I)
LiveRanges.resize(NumAllocas);
collectMarkers();
+}
+void StackColoring::run() {
if (!ClColoring) {
for (auto &R : LiveRanges) {
R.SetMaximum(1);
void calculateLiveIntervals();
public:
- StackColoring(Function &F, ArrayRef<AllocaInst *> Allocas)
- : F(F), Allocas(Allocas), NumAllocas(Allocas.size()) {}
+ StackColoring(Function &F, ArrayRef<AllocaInst *> Allocas);
void run();
void removeAllMarkers();