title: Minimal code for dynamically loaded Analysis Pass and Analysis Group in LLVM
body: <p>If I am building a library externally from LLVM, what is the minimal code to define and properly "register" an Analysis Group and a pass which is part of that group?  How would it look if the pass depends on the results of a previous analysis?</p>
  
  <p>The document on <a href="http://llvm.org/docs/WritingAnLLVMPass.html" rel="nofollow">writing an LLVM pass</a> has information on what to do in different scenarios, but it is spread across many sections and some of it seems to contradict the source code and comments of the latest LLVM.  I am looking for the full source code of the files required, like they give for the basic Hello World Pass.</p>