title: Run default optimization pipeline using modern LLVM
body: <p>I'm using LLVM 7 and I have an <code>llvm::Module</code> that I'd like to optimize using the standard optimization pipeline. Unfortunately, there isn't a <code>llvm::runDefaultOptimizations</code> function that I can call. There seems to be a bajillion ways to optimize a module in LLVM. My searches on this topic have found many old/depreciated APIs and some examples that don't work on my system.</p>
  
  <p>I want to run all of the standard optimizations at <code>-O3</code> with the least amount of hassle possible. I don't want to manually list all of the passes or even write a for loop. I thought <code>llvm::PassBuilder::buildModuleOptimizationPipeline</code> might be the solution but I get a linker error when I try to use that function which I think is really strange.</p>