OSDN Git Service

ReversePostOrderFunctionAttrs is not modifying the call graph, let's preserve it.
authorMehdi Amini <mehdi.amini@apple.com>
Mon, 2 May 2016 18:03:33 +0000 (18:03 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Mon, 2 May 2016 18:03:33 +0000 (18:03 +0000)
When running cc1 with -flto=thin, it is followed by GlobalOpt, which
requires the callgraph. This saves rebuilding one.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268266 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/FunctionAttrs.cpp

index 91768f5..b6ebc63 100644 (file)
@@ -1153,6 +1153,7 @@ struct ReversePostOrderFunctionAttrs : public ModulePass {
   void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.setPreservesCFG();
     AU.addRequired<CallGraphWrapperPass>();
+    AU.addPreserved<CallGraphWrapperPass>();
   }
 };
 }