title: Segmentation fault while using AAResultsWrapperPass in LLVM 5.0.1
body: <p>I am trying to use AliasAnalysis (LLVM 5.01) and my code is as following:</p>
  
  <pre><code>void getAnalysisUsage(AnalysisUsage &amp;AU) const override {
    AU.addRequired&lt;AAResultsWrapperPass&gt;();
  }
  </code></pre>
  
  <p>And I am get the AliasAnalysis as follow:</p>
  
  <pre><code>AA = &amp;getAnalysis&lt;AAResultsWrapperPass&gt;().getAAResults();
  </code></pre>
  
  <p>This code is getting compiled properly. But when I run this, I am getting following errors:</p>
  
  <pre><code>clang -Xclang -load -Xclang /home/zhangjun/tools/llvm/llvm-build/lib/LLVMCPI.so -O0 -c test.c 
  Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.
  Verify if there is a pass dependency cycle. 
  Required Passes:clang-5.0: /home/zhangjun/tools/llvm/llvm/lib/IR/LegacyPassManager.cpp:653: void  llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI &amp;&amp; "Expected required passes to be initialized"' failed.
  #0 0x0000000002dae43f llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) /home/zhangjun/tools/llvm/llvm/lib/Support/Unix/Signals.inc:398:0
  #1 0x0000000002dae4d0 PrintStackTraceSignalHandler(void*) /home/zhangjun/tools/llvm/llvm/lib/Support/Unix/Signals.inc:462:0
  #2 0x0000000002dac916 llvm::sys::RunSignalHandlers() /home/zhangjun/tools/llvm/llvm/lib/Support/Signals.cpp:49:0
  #3 0x0000000002daddd7 SignalHandler(int) /home/zhangjun/tools/llvm/llvm/lib/Support/Unix/Signals.inc:252:0
  </code></pre>
  
  <p>Some one propose passing current function as argument to this function to solve this issue (<a href="https://stackoverflow.com/questions/43033274/segmentation-fault-while-using-aaresultswrapperpass-in-llvm3-8-1">Segmentation fault while using AAResultsWrapperPass in llvm3.8.1</a>)</p>
  
  <pre><code>getAnalysis&lt;AAResultsWrapperPass&gt;().getAAResults() - NOT working
  getAnalysis&lt;AAResultsWrapperPass&gt;().getAAResults(F)- working
  </code></pre>
  
  <p>However, his method does not work for me. How to deal with this problems?</p>