<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60699>60699</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            how does a pass written by new passmanager use getAnalysis()?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          PressFforlove
      </td>
    </tr>
</table>

<pre>
    Hi there, i'm trying to use **getAnalysis()** method to get some information about domtree or loops, and i tried to write a pass following the llvm15 document, it's works by use “ **AM.getResult<HelloAnalysis>(F)**; ”,inside the template is an analysis pass which returns a std::string.

In my opinion, DomTree and LoopInfo are also **analysis** passes, so they should work too. when i try to use "auto &DT = **getAnalysis<DominatorTree>()**;", or "**LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo()**;", which worked fine in a pass i written some month ago by runOnModule(by set getAnalysisUsage,and include the head of these modules). but when i use it in my pass written by new pass manager, the compiler complain like below:
"HelloWorldUse.cpp:62:16: **error: ‘getAnalysis’ was not declared in this scope**
     auto &DT = getAnalysis<DominatorTree>();"
and
"**error: expected primary-expression before ‘>’ token**
     auto &DT = getAnalysis<DominatorTree>();"
now i am so confused to the new pass manager and how to use getAnalysis() to use other pass's data or method in a **FunctionPass**
. By the way, i also want to know how to get a FunctionPass's data or method in another FunctionPass.
any answer or link will be appreciated, thank you for help!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVUGv2joT_TVmMyoKDgSyYMGFolZq9VWfWnXtxEPih-OJbKdp_v3TOIHe9t3FW7y7uIQknjlzzpmDCsE0DvEodi9id1mpIbbkj188hnC9kbf0A1cV6en4wUBs0aOQZzBC7juIfjKugUgwBAQhT0KeGownp-wUTBDyIGQ534YOY0ua320wQqAOwbgb-U5FQw5URUMETV30iEAeLFEfuJVyGgxEbzCdHr2JCAp6FQLcyFoaE4YWw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