[llvm] [LLVM][NewPM] Add a C API for setting the PassBuilder AA pipeline. (PR #102482)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 00:50:03 PDT 2024


================
@@ -60,6 +64,15 @@ LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
   FunctionAnalysisManager FAM;
   CGSCCAnalysisManager CGAM;
   ModuleAnalysisManager MAM;
+  if (PassOpts->AAPipeline) {
+    // If we have a custom AA pipeline, we need to register it _before_ calling
+    // registerFunctionAnalyses, or the default alias analysis pipeline is used.
+    AAManager AA;
+    if (auto Err = PB.parseAAPipeline(AA, PassOpts->AAPipeline)) {
----------------
nikic wrote:

Drop braces.

https://github.com/llvm/llvm-project/pull/102482


More information about the llvm-commits mailing list