Declare that lowerinvoke doesn't interact with other lowering passes.
Patch written by Domagoj Babic!

llvm-svn: 28367
diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
index f6e70e1..dab8084 100644
--- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
@@ -41,11 +41,12 @@
       AU.addRequired<TargetData>();
       AU.setPreservesCFG();
 
-      // This is a cluster of orthogonal Transforms:
+      // This is a cluster of orthogonal Transforms:	
       AU.addPreserved<UnifyFunctionExitNodes>();
       AU.addPreservedID(PromoteMemoryToRegisterID);
       AU.addPreservedID(LowerSelectID);
       AU.addPreservedID(LowerSwitchID);
+      AU.addPreservedID(LowerInvokePassID);
     }
 
     /// doPassInitialization - For the lower allocations pass, this ensures that
diff --git a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
index be706c3..f7cb65c 100644
--- a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
@@ -71,7 +71,15 @@
       JumpBufAlign(Align) {}
     bool doInitialization(Module &M);
     bool runOnFunction(Function &F);
-    
+ 
+    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+      // This is a cluster of orthogonal Transforms	
+      AU.addPreservedID(PromoteMemoryToRegisterID);
+      AU.addPreservedID(LowerSelectID);
+      AU.addPreservedID(LowerSwitchID);
+      AU.addPreservedID(LowerAllocationsID);
+    }
+       
   private:
     void createAbortMessage();
     void writeAbortMessage(Instruction *IB);
diff --git a/llvm/lib/Transforms/Scalar/LowerSelect.cpp b/llvm/lib/Transforms/Scalar/LowerSelect.cpp
index 27dd430..464d30d 100644
--- a/llvm/lib/Transforms/Scalar/LowerSelect.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerSelect.cpp
@@ -39,10 +39,12 @@
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       // This certainly destroys the CFG.
-      // This is a cluster of orthogonal Transforms:
+      // This is a cluster of orthogonal Transforms:	
       AU.addPreserved<UnifyFunctionExitNodes>();
       AU.addPreservedID(PromoteMemoryToRegisterID);
       AU.addPreservedID(LowerSwitchID);
+      AU.addPreservedID(LowerInvokePassID);
+      AU.addPreservedID(LowerAllocationsID);
     }
 
     bool runOnFunction(Function &F);
diff --git a/llvm/lib/Transforms/Scalar/LowerSwitch.cpp b/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
index 14d3027..379a2e4 100644
--- a/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerSwitch.cpp
@@ -34,14 +34,16 @@
   class LowerSwitch : public FunctionPass {
   public:
     virtual bool runOnFunction(Function &F);
-
+    
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      // This is a cluster of orthogonal Transforms
+      // This is a cluster of orthogonal Transforms	
       AU.addPreserved<UnifyFunctionExitNodes>();
       AU.addPreservedID(PromoteMemoryToRegisterID);
       AU.addPreservedID(LowerSelectID);
+      AU.addPreservedID(LowerInvokePassID);
+      AU.addPreservedID(LowerAllocationsID);
     }
-
+        
     typedef std::pair<Constant*, BasicBlock*> Case;
     typedef std::vector<Case>::iterator       CaseItr;
   private:
diff --git a/llvm/lib/Transforms/Scalar/Mem2Reg.cpp b/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
index 9ca2c83..5e5d67b 100644
--- a/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
@@ -38,10 +38,12 @@
       AU.addRequired<DominanceFrontier>();
       AU.addRequired<TargetData>();
       AU.setPreservesCFG();
-      // This is a cluster of orthogonal Transforms
+      // This is a cluster of orthogonal Transforms	
       AU.addPreserved<UnifyFunctionExitNodes>();
       AU.addPreservedID(LowerSelectID);
       AU.addPreservedID(LowerSwitchID);
+      AU.addPreservedID(LowerInvokePassID);
+      AU.addPreservedID(LowerAllocationsID);
     }
   };