[llvm] e7137f2 - [Passes] Try to fix build on windows

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 01:05:34 PDT 2024


Author: Nikita Popov
Date: 2024-06-24T10:05:25+02:00
New Revision: e7137f2fed5cfee822ae3c4c6d39188adb59a16c

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

LOG: [Passes] Try to fix build on windows

Some passes reference *this (inside decltype) which fails with
MSVC. Fix this by not explicitly specifying the captures (otherwise
we would get an unused lambda capture warning for cases where this
is *not* used).

Added: 
    

Modified: 
    llvm/include/llvm/Passes/TargetPassRegistry.inc

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Passes/TargetPassRegistry.inc b/llvm/include/llvm/Passes/TargetPassRegistry.inc
index aa5066920cb7c..29198b917aa7d 100644
--- a/llvm/include/llvm/Passes/TargetPassRegistry.inc
+++ b/llvm/include/llvm/Passes/TargetPassRegistry.inc
@@ -23,7 +23,7 @@
 
 auto *PIC = PB.getPassInstrumentationCallbacks();
 if (PIC) {
-  PIC->registerClassToPassNameCallback([PIC]() {
+  PIC->registerClassToPassNameCallback([&]() {
 #define ADD_CLASS_PASS_TO_PASS_NAME(NAME, CREATE_PASS)                         \
   PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
 #define ADD_CLASS_PASS_TO_PASS_NAME_WITH_PARAMS(NAME, CLASS)                   \


        


More information about the llvm-commits mailing list