Fix spelling and grammar in a comment.
[oota-llvm.git] / lib / CodeGen / LoopAligner.cpp
index c5a3f549a76535826eb2e1a2ae77b7baf36d3c81..1888391d5e7145aed221d3565e5ee657e85adc25 100644 (file)
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Target/TargetLowering.h"
 #include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 using namespace llvm;
 
 namespace {
   class LoopAligner : public MachineFunctionPass {
-    const TargetLowering *TLI;
-
   public:
     static char ID;
     LoopAligner() : MachineFunctionPass((intptr_t)&ID) {}
@@ -52,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.