Skip to content

Conversation

fsfod
Copy link
Contributor

@fsfod fsfod commented Oct 15, 2024

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Oct 15, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Thomas Fransham (fsfod)

Changes

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.


Full diff: https://github.com/llvm/llvm-project/pull/112303.diff

2 Files Affected:

  • (modified) llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt (+1-1)
  • (modified) llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt (+1-1)
diff --git a/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt b/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
index 22cd0cb1d9a034..deabf110f2e439 100644
--- a/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
+++ b/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
@@ -2,7 +2,7 @@
 # libraries, but expects them to exist in the process loading the plugin. This 
 # doesn't work with DLLs on Windows (where a shared library can't have undefined
 # references), so just skip this testcase on Windows.
-if (NOT WIN32 AND NOT CYGWIN)
+if ((NOT WIN32 OR LLVM_BUILD_LLVM_DYLIB) AND NOT CYGWIN)
   unset(LLVM_LINK_COMPONENTS)
   add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY
     InlineAdvisorPlugin.cpp
diff --git a/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt b/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
index cc470a934426d5..0b37cebe3da6de 100644
--- a/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
+++ b/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
@@ -2,7 +2,7 @@
 # libraries, but expects them to exist in the process loading the plugin. This 
 # doesn't work with DLLs on Windows (where a shared library can't have undefined
 # references), so just skip this testcase on Windows.
-if (NOT WIN32 AND NOT CYGWIN)
+if ((NOT WIN32 OR LLVM_BUILD_LLVM_DYLIB) AND NOT CYGWIN)
   unset(LLVM_LINK_COMPONENTS)
   add_llvm_library(InlineOrderPlugin MODULE BUILDTREE_ONLY
     InlineOrderPlugin.cpp

@vgvassilev vgvassilev requested a review from dwblaikie October 23, 2024 18:28
@vgvassilev
Copy link
Contributor

Hi @dwblaikie, this lgtm but since I could not find an obvious reviewer maybe that's around an area you have experience with?

Copy link
Collaborator

@dwblaikie dwblaikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I guess - best of luck :)

@vgvassilev vgvassilev merged commit 69ead94 into llvm:main Oct 26, 2024
10 checks passed
@vgvassilev
Copy link
Contributor

Sure, I guess - best of luck :)

Thank you!

winner245 pushed a commit to winner245/llvm-project that referenced this pull request Oct 26, 2024
Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM
plugins on window.
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM
plugins on window.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Jul 30, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case.  Their dynamic libraries work the same
way, so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit that referenced this pull request Jul 31, 2025
In #112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 6, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 9, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 12, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 26, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Sep 12, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Sep 23, 2025
In llvm#112303 they were enabled for Windows dylib builds, but the condition
excluded Cygwin in that case. Their dynamic libraries work the same way,
so adjust the condition accordingly.

This fixes the plugin tests on Cygwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants