aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopPassManager.cpp
diff options
context:
space:
mode:
authorThomas Fransham <tfransham@gmail.com>2024-10-24 06:07:13 +0100
committerGitHub <noreply@github.com>2024-10-24 08:07:13 +0300
commitb8fddca7bdb354d51e340c60aafe3dff1b35a195 (patch)
tree32cf454e09c96fa3c3595fcfa3c212af58024333 /llvm/lib/Transforms/Scalar/LoopPassManager.cpp
parent04f14e4d652a344fedea6de8df532e88a652bcc4 (diff)
downloadllvm-b8fddca7bdb354d51e340c60aafe3dff1b35a195.zip
llvm-b8fddca7bdb354d51e340c60aafe3dff1b35a195.tar.gz
llvm-b8fddca7bdb354d51e340c60aafe3dff1b35a195.tar.bz2
[llvm] Support llvm::Any across shared libraries on windows (#108051)
This is part of the effort to support for enabling plugins on windows by adding better support for building llvm as a DLL. The export macros used here were added in #96630 Since shared library symbols aren't deduplicated across multiple libraries on windows like Linux we have to manually explicitly import and export `Any::TypeId` template instantiations for the uses of `llvm::Any` in the LLVM codebase to support LLVM Windows shared library builds. This change ensures that external code, including LLVM's own tests, can use PassManager callbacks when LLVM is built as a DLL. I also removed the only use of llvm::Any for LoopNest that only existed in debug code and there also doesn't seem to be any code creating `Any<LoopNest>`
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopPassManager.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopPassManager.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp
index 5ef25c2..d3bcfb8 100644
--- a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp
@@ -269,12 +269,9 @@ PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F,
PI.pushBeforeNonSkippedPassCallback([&LAR, &LI](StringRef PassID, Any IR) {
if (isSpecialPass(PassID, {"PassManager"}))
return;
- assert(llvm::any_cast<const Loop *>(&IR) ||
- llvm::any_cast<const LoopNest *>(&IR));
+ assert(llvm::any_cast<const Loop *>(&IR));
const Loop **LPtr = llvm::any_cast<const Loop *>(&IR);
const Loop *L = LPtr ? *LPtr : nullptr;
- if (!L)
- L = &llvm::any_cast<const LoopNest *>(IR)->getOutermostLoop();
assert(L && "Loop should be valid for printing");
// Verify the loop structure and LCSSA form before visiting the loop.