X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FLoopAligner.cpp;h=1888391d5e7145aed221d3565e5ee657e85adc25;hb=ebcba612b537f45a033ccd9a60bee0c45e2e2ded;hp=a40bb50565d3863bc520d726ea4bab6e06beaf9a;hpb=fb8075d03f5c87bd57dcc9c5f2304f6b13c55aad;p=oota-llvm.git diff --git a/lib/CodeGen/LoopAligner.cpp b/lib/CodeGen/LoopAligner.cpp index a40bb50565d..1888391d5e7 100644 --- a/lib/CodeGen/LoopAligner.cpp +++ b/lib/CodeGen/LoopAligner.cpp @@ -24,8 +24,6 @@ using namespace llvm; namespace { class LoopAligner : public MachineFunctionPass { - const TargetLowering *TLI; - public: static char ID; LoopAligner() : MachineFunctionPass((intptr_t)&ID) {} @@ -51,7 +49,11 @@ bool LoopAligner::runOnMachineFunction(MachineFunction &MF) { if (MLI->begin() == MLI->end()) return false; // No loops. - unsigned Align = MF.getTarget().getTargetLowering()->getPrefLoopAlignment(); + const TargetLowering *TLI = MF.getTarget().getTargetLowering(); + if (!TLI) + return false; + + unsigned Align = TLI->getPrefLoopAlignment(); if (!Align) return false; // Don't care about loop alignment.