[llvm] 10b61fe - [llvm] include GenericLoopInfoImpl for full implementation (#144621)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 09:33:37 PDT 2025


Author: Andrew Rogers
Date: 2025-06-23T09:33:34-07:00
New Revision: 10b61fea8a1a458b6b9e4a4b375883d21f096468

URL: https://github.com/llvm/llvm-project/commit/10b61fea8a1a458b6b9e4a4b375883d21f096468
DIFF: https://github.com/llvm/llvm-project/commit/10b61fea8a1a458b6b9e4a4b375883d21f096468.diff

LOG: [llvm] include GenericLoopInfoImpl for full implementation (#144621)

MSVC issues a warning when a an `extern` template instantiation is
annotated for DLL export but it does not have the complete template
definition. Because the full implementation of `LoopBase` is in
`GenericLoopInfoImpl.h` rather than `GenericLoopInfo.h`, MSVC complains
whenever `LoopInfo.h` is included.
```
S:\llvm\llvm-project\llvm\include\llvm/Support/GenericLoopInfo.h(342): warning C4661: 'BlockT *llvm::LoopBase<BlockT,llvm::Loop>::getLoopLatch(void) const': no suitable definition provided for explicit template instantiation request
        with
        [
            BlockT=llvm::BasicBlock
        ]
S:\llvm\llvm-project\llvm\include\llvm/Support/GenericLoopInfo.h(326): note: see declaration of 'llvm::LoopBase<llvm::BasicBlock,llvm::Loop>::getLoopLatch'
```
Everything links fine but the warning is very noisy when building LLVM
as a Windows DLL. Interestingly, `clang-cl` does not warn here and is
fine with the code as-is.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/LoopInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 072ddad546bf3..a7a6a2753709c 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -18,7 +18,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/GenericLoopInfo.h"
+#include "llvm/Support/GenericLoopInfoImpl.h"
 #include <optional>
 #include <utility>
 


        


More information about the llvm-commits mailing list