[llvm-commits] [llvm] r63198 - in /llvm/trunk: docs/ include/llvm/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/AsmPrinter/ lib/Target/CellSPU/AsmPrinter/ lib/Target/PowerPC/AsmPrinter/ lib/Target/X86/AsmPrinter/ lib/Target/XCore/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/

Duncan Sands baldrick at free.fr
Wed Jan 28 05:14:30 PST 2009


Author: baldrick
Date: Wed Jan 28 07:14:17 2009
New Revision: 63198

URL: http://llvm.org/viewvc/llvm-project?rev=63198&view=rev
Log:
Rename getAnalysisToUpdate to getAnalysisIfAvailable.

Modified:
    llvm/trunk/docs/CompilerDriver.html
    llvm/trunk/docs/WritingAnLLVMPass.html
    llvm/trunk/include/llvm/Pass.h
    llvm/trunk/include/llvm/PassAnalysisSupport.h
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/BranchFolding.cpp
    llvm/trunk/lib/CodeGen/GCMetadata.cpp
    llvm/trunk/lib/CodeGen/GCStrategy.cpp
    llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
    llvm/trunk/lib/CodeGen/PHIElimination.cpp
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
    llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
    llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
    llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
    llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
    llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
    llvm/trunk/lib/Transforms/IPO/Internalize.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
    llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
    llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
    llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp
    llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
    llvm/trunk/lib/VMCore/Pass.cpp
    llvm/trunk/lib/VMCore/PassManager.cpp

Modified: llvm/trunk/docs/CompilerDriver.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerDriver.html?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/docs/CompilerDriver.html (original)
+++ llvm/trunk/docs/CompilerDriver.html Wed Jan 28 07:14:17 2009
@@ -611,7 +611,7 @@
 <a href="mailto:foldr at codedgers.com">Mikhail Glushenkov</a><br />
 <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br />
 
-Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $
+Last modified: $Date$
 </address></div>
 </div>
 </div>

Modified: llvm/trunk/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Wed Jan 28 07:14:17 2009
@@ -78,7 +78,8 @@
      <li><a href="#AU::addRequired">The <tt>AnalysisUsage::addRequired<></tt> and <tt>AnalysisUsage::addRequiredTransitive<></tt> methods</a></li>
      <li><a href="#AU::addPreserved">The <tt>AnalysisUsage::addPreserved<></tt> method</a></li>
      <li><a href="#AU::examples">Example implementations of <tt>getAnalysisUsage</tt></a></li>
-     <li><a href="#getAnalysis">The <tt>getAnalysis<></tt> and <tt>getAnalysisToUpdate<></tt> methods</a></li>
+     <li><a href="#getAnalysis">The <tt>getAnalysis<></tt> and
+<tt>getAnalysisIfAvailable<></tt> methods</a></li>
      </ul></li>
   <li><a href="#analysisgroup">Implementing Analysis Groups</a>
      <ul>
@@ -1131,7 +1132,8 @@
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="getAnalysis">The <tt>getAnalysis<></tt> and <tt>getAnalysisToUpdate<></tt> methods</a>
+  <a name="getAnalysis">The <tt>getAnalysis<></tt> and
+<tt>getAnalysisIfAvailable<></tt> methods</a>
 </div>
 
 <div class="doc_text">
@@ -1173,12 +1175,12 @@
 <p>
 If your pass is capable of updating analyses if they exist (e.g.,
 <tt>BreakCriticalEdges</tt>, as described above), you can use the
-<tt>getAnalysisToUpdate</tt> method, which returns a pointer to the analysis if
-it is active.  For example:</p>
+<tt>getAnalysisIfAvailable</tt> method, which returns a pointer to the analysis
+if it is active.  For example:</p>
 
 <div class="doc_code"><pre>
   ...
-  if (DominatorSet *DS = getAnalysisToUpdate<DominatorSet>()) {
+  if (DominatorSet *DS = getAnalysisIfAvailable<DominatorSet>()) {
     <i>// A DominatorSet is active.  This code will update it.</i>
   }
   ...

Modified: llvm/trunk/include/llvm/Pass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Pass.h (original)
+++ llvm/trunk/include/llvm/Pass.h Wed Jan 28 07:14:17 2009
@@ -169,22 +169,22 @@
   // or null if it is not known.
   static const PassInfo *lookupPassInfo(intptr_t TI);
 
-  /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
-  /// to get to the analysis information that might be around that needs to be
-  /// updated.  This is different than getAnalysis in that it can fail (ie the
-  /// analysis results haven't been computed), so should only be used if you
-  /// provide the capability to update an analysis that exists.  This method is
-  /// often used by transformation APIs to update analysis results for a pass
-  /// automatically as the transform is performed.
+  /// getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to
+  /// get analysis information that might be around, for example to update it.
+  /// This is different than getAnalysis in that it can fail (if the analysis
+  /// results haven't been computed), so should only be used if you can handle
+  /// the case when the analysis is not available.  This method is often used by
+  /// transformation APIs to update analysis results for a pass automatically as
+  /// the transform is performed.
   ///
-  template<typename AnalysisType>
-  AnalysisType *getAnalysisToUpdate() const; // Defined in PassAnalysisSupport.h
+  template<typename AnalysisType> AnalysisType *
+    getAnalysisIfAvailable() const; // Defined in PassAnalysisSupport.h
 
   /// mustPreserveAnalysisID - This method serves the same function as
-  /// getAnalysisToUpdate, but works if you just have an AnalysisID.  This
+  /// getAnalysisIfAvailable, but works if you just have an AnalysisID.  This
   /// obviously cannot give you a properly typed instance of the class if you
-  /// don't have the class name available (use getAnalysisToUpdate if you do),
-  /// but it can tell you if you need to preserve the pass at least.
+  /// don't have the class name available (use getAnalysisIfAvailable if you
+  /// do), but it can tell you if you need to preserve the pass at least.
   ///
   bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const;
 

Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/include/llvm/PassAnalysisSupport.h (original)
+++ llvm/trunk/include/llvm/PassAnalysisSupport.h Wed Jan 28 07:14:17 2009
@@ -143,8 +143,8 @@
     AnalysisImpls.push_back(pir);
   }
 
-  // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
-  Pass *getAnalysisToUpdate(AnalysisID ID, bool Direction) const;
+  // getAnalysisIfAvailable - Return analysis result or null if it doesn't exist
+  Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const;
 
   // AnalysisImpls - This keeps track of which passes implements the interfaces
   // that are required by the current pass (to implement getAnalysis()).
@@ -157,22 +157,22 @@
   PMDataManager &PM;
 };
 
-/// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
-/// to get to the analysis information that might be around that needs to be
-/// updated.  This is different than getAnalysis in that it can fail (ie the
-/// analysis results haven't been computed), so should only be used if you
-/// provide the capability to update an analysis that exists.  This method is
-/// often used by transformation APIs to update analysis results for a pass
-/// automatically as the transform is performed.
+/// getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to
+/// get analysis information that might be around, for example to update it.
+/// This is different than getAnalysis in that it can fail (if the analysis
+/// results haven't been computed), so should only be used if you can handle
+/// the case when the analysis is not available.  This method is often used by
+/// transformation APIs to update analysis results for a pass automatically as
+/// the transform is performed.
 ///
 template<typename AnalysisType>
-AnalysisType *Pass::getAnalysisToUpdate() const {
+AnalysisType *Pass::getAnalysisIfAvailable() const {
   assert(Resolver && "Pass not resident in a PassManager object!");
 
   const PassInfo *PI = getClassPassInfo<AnalysisType>();
   if (PI == 0) return 0;
   return dynamic_cast<AnalysisType*>
-    (Resolver->getAnalysisToUpdate(PI, true));
+    (Resolver->getAnalysisIfAvailable(PI, true));
 }
 
 /// getAnalysis<AnalysisType>() - This function is used by subclasses to get

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -141,7 +141,7 @@
 bool AsmPrinter::doInitialization(Module &M) {
   Mang = new Mangler(M, TAI->getGlobalPrefix(), TAI->getPrivateGlobalPrefix());
   
-  GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>();
+  GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
   assert(MI && "AsmPrinter didn't require GCModuleInfo?");
 
   if (TAI->hasSingleParameterDotFile()) {
@@ -163,9 +163,9 @@
 
   SwitchToDataSection("");   // Reset back to no section.
   
-  MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   if (MMI) MMI->AnalyzeModule(M);
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   return false;
 }
 
@@ -218,7 +218,7 @@
     }
   }
 
-  GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>();
+  GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
   assert(MI && "AsmPrinter didn't require GCModuleInfo?");
   for (GCModuleInfo::iterator I = MI->end(), E = MI->begin(); I != E; )
     if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*--I))

Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Wed Jan 28 07:14:17 2009
@@ -198,7 +198,7 @@
 
   RS = RegInfo->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
 
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
 
   bool MadeChangeThisIteration = true;
   while (MadeChangeThisIteration) {

Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Wed Jan 28 07:14:17 2009
@@ -205,7 +205,7 @@
 }
 
 bool Deleter::doFinalization(Module &M) {
-  GCModuleInfo *GMI = getAnalysisToUpdate<GCModuleInfo>();
+  GCModuleInfo *GMI = getAnalysisIfAvailable<GCModuleInfo>();
   assert(GMI && "Deleter didn't require GCModuleInfo?!");
   GMI->clear();
   return false;

Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Wed Jan 28 07:14:17 2009
@@ -144,7 +144,7 @@
   //        work against the entire module. But this cannot be done at
   //        runFunction time (initializeCustomLowering likely needs to change
   //        the module).
-  GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>();
+  GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
   assert(MI && "LowerIntrinsics didn't require GCModuleInfo!?");
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isDeclaration() && I->hasGC())

Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Jan 28 07:14:17 2009
@@ -320,7 +320,7 @@
 
 bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
   // Get machine module info.
-  MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   if (!MMI) return false;
   
   // Track if change is made.

Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Wed Jan 28 07:14:17 2009
@@ -174,7 +174,7 @@
   }
 
   // Update live variable information if there is any.
-  LiveVariables *LV = getAnalysisToUpdate<LiveVariables>();
+  LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>();
   if (LV) {
     MachineInstr *PHICopy = prior(AfterPHIsIt);
 

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jan 28 07:14:17 2009
@@ -56,7 +56,7 @@
 
       // Get MachineModuleInfo so that we can track the construction of the
       // frame.
-      if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>())
+      if (MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>())
         Fn.getFrameInfo()->setMachineModuleInfo(MMI);
 
       // Allow the target machine to make some adjustments to the function

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jan 28 07:14:17 2009
@@ -314,8 +314,8 @@
   DOUT << "\n\n\n=== " << Fn.getName() << "\n";
 
   FuncInfo->set(Fn, *MF, EnableFastISel);
-  MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
-  DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
+  MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+  DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
   CurDAG->init(*MF, MMI, DW);
   SDL->init(GFI, *AA);
 

Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Wed Jan 28 07:14:17 2009
@@ -379,7 +379,7 @@
   MRI = &MF.getRegInfo();
   TII = TM.getInstrInfo();
   TRI = TM.getRegisterInfo();
-  LV = getAnalysisToUpdate<LiveVariables>();
+  LV = getAnalysisIfAvailable<LiveVariables>();
 
   bool MadeChange = false;
 

Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Wed Jan 28 07:14:17 2009
@@ -105,7 +105,7 @@
 bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
   SmallPtrSet<MachineBasicBlock*, 8> Reachable;
 
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
 
   // Mark all reachable blocks.
   for (df_ext_iterator<MachineFunction*, SmallPtrSet<MachineBasicBlock*, 8> >

Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -782,9 +782,9 @@
   bool Result = AsmPrinter::doInitialization(M);
 
   // Emit initial debug information.
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   assert(MMI);
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   assert(DW && "Dwarf Writer is not available");
   DW->BeginModule(&M, MMI, O, this, TAI);
 

Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -491,9 +491,9 @@
   bool Result = AsmPrinter::doInitialization(M);
   SwitchToTextSection("\t.text");
   // Emit initial debug information.
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   assert(DW && "Dwarf Writer is not available");
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   DW->BeginModule(&M, MMI, O, this, TAI);
   return Result;
 }

Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -641,9 +641,9 @@
   bool Result = AsmPrinter::doInitialization(M);
 
   // Emit initial debug information.
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   assert(MMI);
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   assert(DW && "DwarfWriter is not available");
   DW->BeginModule(&M, MMI, O, this, TAI);
 
@@ -859,9 +859,9 @@
   // Emit initial debug information.
   // We need this for Personality functions.
   // AsmPrinter::doInitialization should have done this analysis.
-  MMI = getAnalysisToUpdate<MachineModuleInfo>();
+  MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   assert(MMI);
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   assert(DW && "DwarfWriter is not available");
   DW->BeginModule(&M, MMI, O, this, TAI);
 

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -737,8 +737,8 @@
     // Let PassManager know we need debug information and relay
     // the MachineModuleInfo address on to DwarfWriter.
     // AsmPrinter::doInitialization did this analysis.
-    MMI = getAnalysisToUpdate<MachineModuleInfo>();
-    DW = getAnalysisToUpdate<DwarfWriter>();
+    MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+    DW = getAnalysisIfAvailable<DwarfWriter>();
     DW->BeginModule(&M, MMI, O, this, TAI);
   }
 
@@ -975,7 +975,7 @@
     }
 
     // Emit final debug information.
-    DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
+    DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
     DW->EndModule();
 
     // Funny Darwin hack: This flag tells the linker that no global symbols
@@ -995,11 +995,11 @@
     }
 
     // Emit final debug information.
-    DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
+    DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
     DW->EndModule();
   } else if (Subtarget->isTargetELF()) {
     // Emit final debug information.
-    DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
+    DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
     DW->EndModule();
   }
 

Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Wed Jan 28 07:14:17 2009
@@ -441,9 +441,9 @@
   }
 
   // Emit initial debug information.
-  DW = getAnalysisToUpdate<DwarfWriter>();
+  DW = getAnalysisIfAvailable<DwarfWriter>();
   assert(DW && "Dwarf Writer is not available");
-  DW->BeginModule(&M, getAnalysisToUpdate<MachineModuleInfo>(), 
+  DW->BeginModule(&M, getAnalysisIfAvailable<MachineModuleInfo>(),
                   O, this, TAI);
   return Result;
 }

Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Wed Jan 28 07:14:17 2009
@@ -99,7 +99,7 @@
 }
 
 bool InternalizePass::runOnModule(Module &M) {
-  CallGraph *CG = getAnalysisToUpdate<CallGraph>();
+  CallGraph *CG = getAnalysisIfAvailable<CallGraph>();
   CallGraphNode *ExternalNode = CG ? CG->getExternalCallingNode() : 0;
 
   if (ExternalNames.empty()) {

Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Wed Jan 28 07:14:17 2009
@@ -457,7 +457,7 @@
            "Expected only one incoming value from Original PreHeader");
   }
 
-  if (DominatorTree *DT = getAnalysisToUpdate<DominatorTree>()) {
+  if (DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>()) {
     DT->addNewBlock(NewPreHeader, OrigPreHeader);
     DT->changeImmediateDominator(L->getHeader(), NewPreHeader);
     DT->changeImmediateDominator(Exit, OrigPreHeader);
@@ -473,7 +473,7 @@
     DT->changeImmediateDominator(OrigHeader, OrigLatch);
   }
 
-  if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) {
+  if (DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>()) {
     // New Preheader's dominance frontier is Exit block.
     DominanceFrontier::DomSetType NewPHSet;
     NewPHSet.insert(Exit);
@@ -509,7 +509,7 @@
     // If a loop block dominates new loop latch then its frontier is
     // new header and Exit.
     BasicBlock *NewLatch = L->getLoopLatch();
-    DominatorTree *DT = getAnalysisToUpdate<DominatorTree>();
+    DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>();
     for (Loop::block_iterator BI = L->block_begin(), BE = L->block_end();
          BI != BE; ++BI) {
       BasicBlock *B = *BI;

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Wed Jan 28 07:14:17 2009
@@ -170,10 +170,10 @@
     return false;
 
   // FIXME: Reconstruct dom info, because it is not preserved properly.
-  DominatorTree *DT = getAnalysisToUpdate<DominatorTree>();
+  DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>();
   if (DT) {
     DT->runOnFunction(*F);
-    DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>();
+    DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>();
     if (DF)
       DF->runOnFunction(*F);
   }

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jan 28 07:14:17 2009
@@ -188,8 +188,8 @@
 bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {
   LI = &getAnalysis<LoopInfo>();
   LPM = &LPM_Ref;
-  DF = getAnalysisToUpdate<DominanceFrontier>();
-  DT = getAnalysisToUpdate<DominatorTree>();
+  DF = getAnalysisIfAvailable<DominanceFrontier>();
+  DT = getAnalysisIfAvailable<DominatorTree>();
   currentLoop = L;
   Function *F = currentLoop->getHeader()->getParent();
   bool Changed = false;

Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Wed Jan 28 07:14:17 2009
@@ -136,7 +136,7 @@
   
   // Finally, erase the old block and update dominator info.
   if (P) {
-    if (DominatorTree* DT = P->getAnalysisToUpdate<DominatorTree>()) {
+    if (DominatorTree* DT = P->getAnalysisIfAvailable<DominatorTree>()) {
       DomTreeNode* DTN = DT->getNode(BB);
       DomTreeNode* PredDTN = DT->getNode(PredBB);
   
@@ -299,11 +299,11 @@
   BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
 
   // The new block lives in whichever loop the old one did.
-  if (LoopInfo* LI = P->getAnalysisToUpdate<LoopInfo>())
+  if (LoopInfo* LI = P->getAnalysisIfAvailable<LoopInfo>())
     if (Loop *L = LI->getLoopFor(Old))
       L->addBasicBlockToLoop(New, LI->getBase());
 
-  if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) 
+  if (DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>())
     {
       // Old dominates New. New node domiantes all other nodes dominated by Old.
       DomTreeNode *OldNode = DT->getNode(Old);
@@ -319,7 +319,7 @@
         DT->changeImmediateDominator(*I, NewNode);
     }
 
-  if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>())
+  if (DominanceFrontier *DF = P->getAnalysisIfAvailable<DominanceFrontier>())
     DF->splitBlock(Old);
     
   return New;
@@ -350,12 +350,12 @@
     Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB);
   
   // Update dominator tree and dominator frontier if available.
-  DominatorTree *DT = P ? P->getAnalysisToUpdate<DominatorTree>() : 0;
+  DominatorTree *DT = P ? P->getAnalysisIfAvailable<DominatorTree>() : 0;
   if (DT)
     DT->splitBlock(NewBB);
-  if (DominanceFrontier *DF = P ? P->getAnalysisToUpdate<DominanceFrontier>():0)
+  if (DominanceFrontier *DF = P ? P->getAnalysisIfAvailable<DominanceFrontier>():0)
     DF->splitBlock(NewBB);
-  AliasAnalysis *AA = P ? P->getAnalysisToUpdate<AliasAnalysis>() : 0;
+  AliasAnalysis *AA = P ? P->getAnalysisIfAvailable<AliasAnalysis>() : 0;
   
   
   // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI

Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed Jan 28 07:14:17 2009
@@ -187,7 +187,7 @@
   bool NewBBDominatesDestBB = true;
   
   // Should we update DominatorTree information?
-  if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) {
+  if (DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>()) {
     DomTreeNode *TINode = DT->getNode(TIBB);
 
     // The new block is not the immediate dominator for any other nodes, but
@@ -218,7 +218,7 @@
   }
 
   // Should we update DominanceFrontier information?
-  if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>()) {
+  if (DominanceFrontier *DF = P->getAnalysisIfAvailable<DominanceFrontier>()) {
     // If NewBBDominatesDestBB hasn't been computed yet, do so with DF.
     if (!OtherPreds.empty()) {
       // FIXME: IMPLEMENT THIS!
@@ -252,7 +252,7 @@
   }
   
   // Update LoopInfo if it is around.
-  if (LoopInfo *LI = P->getAnalysisToUpdate<LoopInfo>()) {
+  if (LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>()) {
     // If one or the other blocks were not in a loop, the new block is not
     // either, and thus LI doesn't need to be updated.
     if (Loop *TIL = LI->getLoopFor(TIBB))

Modified: llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp Wed Jan 28 07:14:17 2009
@@ -79,8 +79,8 @@
   DominatorTree *DT = NULL;
   DominanceFrontier *DF = NULL;
   if (P) {
-    DT = P->getAnalysisToUpdate<DominatorTree>();
-    DF = P->getAnalysisToUpdate<DominanceFrontier>();
+    DT = P->getAnalysisIfAvailable<DominatorTree>();
+    DF = P->getAnalysisIfAvailable<DominanceFrontier>();
   }
 
   SmallVector<BasicBlock *, 16> NewBlocks;

Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Wed Jan 28 07:14:17 2009
@@ -112,7 +112,7 @@
 bool LoopSimplify::runOnFunction(Function &F) {
   bool Changed = false;
   LI = &getAnalysis<LoopInfo>();
-  AA = getAnalysisToUpdate<AliasAnalysis>();
+  AA = getAnalysisIfAvailable<AliasAnalysis>();
   DT = &getAnalysis<DominatorTree>();
 
   // Check to see that no blocks (other than the header) in loops have
@@ -595,6 +595,6 @@
 
   // Update dominator information
   DT->splitBlock(BEBlock);
-  if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>())
+  if (DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>())
     DF->splitBlock(BEBlock);
 }

Modified: llvm/trunk/lib/VMCore/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Pass.cpp (original)
+++ llvm/trunk/lib/VMCore/Pass.cpp Wed Jan 28 07:14:17 2009
@@ -37,7 +37,7 @@
 ModulePass::~ModulePass() { }
 
 bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
-  return Resolver->getAnalysisToUpdate(AnalysisID, true) != 0;
+  return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0;
 }
 
 // dumpPassStructure - Implement the -debug-passes=Structure option

Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=63198&r1=63197&r2=63198&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Jan 28 07:14:17 2009
@@ -679,7 +679,7 @@
   if (!VerifyDomInfo || !P.getResolver())
     return;
 
-  DominatorTree *DT = P.getAnalysisToUpdate<DominatorTree>();
+  DominatorTree *DT = P.getAnalysisIfAvailable<DominatorTree>();
   if (!DT)
     return;
 
@@ -695,7 +695,7 @@
     assert (0 && "Invalid dominator info");
   }
 
-  DominanceFrontier *DF = P.getAnalysisToUpdate<DominanceFrontier>();
+  DominanceFrontier *DF = P.getAnalysisIfAvailable<DominanceFrontier>();
   if (!DF) 
     return;
 
@@ -1088,8 +1088,8 @@
 
 //===----------------------------------------------------------------------===//
 // NOTE: Is this the right place to define this method ?
-// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist
-Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const {
+// getAnalysisIfAvailable - Return analysis result or null if it doesn't exist.
+Pass *AnalysisResolver::getAnalysisIfAvailable(AnalysisID ID, bool dir) const {
   return PM.findAnalysisPass(ID, dir);
 }
 





More information about the llvm-commits mailing list