[llvm] [CodeGen] Expose the extensibility of PassConfig to plugins (PR #139059)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 05:55:54 PDT 2025


================
@@ -0,0 +1,114 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugin/CodeGenTestPass.h"
+
+#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/TargetPassConfig.h"
+#include "llvm/Config/config.h"
+#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Support/DynamicLibrary.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/TargetSelect.h"
+#include "llvm/Target/TargetMachine.h"
+
+#include "gtest/gtest.h"
+
+using namespace llvm;
+
+namespace {
+void anchor() {}
+
+std::optional<std::string> libPath(const std::string &Name) {
+  const auto &Argvs = testing::internal::GetArgvs();
+  if (Argvs.size() <= 0)
+    return std::nullopt;
+  void *Ptr = (void *)(intptr_t)anchor;
----------------
arsenm wrote:

Avoid c style casts 

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


More information about the llvm-commits mailing list