Convert several more passes to use getAnalysisIfAvailable<TargetData>()
[oota-llvm.git] / lib / Transforms / Scalar / SimplifyHalfPowrLibCalls.cpp
index 4aad17d7236d454c02bd0fc98062b94d5e90ef1c..80eac87875dd0809e2328b88cb05e16c0a654fa5 100644 (file)
@@ -39,7 +39,6 @@ namespace {
     bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.addRequired<TargetData>();
     }
 
     Instruction *
@@ -123,7 +122,7 @@ SimplifyHalfPowrLibCalls::InlineHalfPowrs(const std::vector<Instruction *> &Half
 /// runOnFunction - Top level algorithm.
 ///
 bool SimplifyHalfPowrLibCalls::runOnFunction(Function &F) {
-  TD = &getAnalysis<TargetData>();
+  TD = getAnalysisIfAvailable<TargetData>();
   
   bool Changed = false;
   std::vector<Instruction *> HalfPowrs;