Skip to content

Commit c950495

Browse files
committed
[MustExecute] Silence clang warning about unused captured 'this'
New code introduced in fe799c9 caused clang to complain with ../lib/Analysis/MustExecute.cpp:360:34: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture] GetterTy<LoopInfo> LIGetter = [this](const Function &F) { ^~~~ ../lib/Analysis/MustExecute.cpp:365:44: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture] GetterTy<PostDominatorTree> PDTGetter = [this](const Function &F) { ^~~~ 2 errors generated.
1 parent 71aa3f7 commit c950495

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/MustExecute.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ bool MustBeExecutedContextPrinter::runOnModule(Module &M) {
357357
// We provide non-PM analysis here because the old PM doesn't like to query
358358
// function passes from a module pass. Given that this is a printer, we don't
359359
// care much about memory leaks.
360-
GetterTy<LoopInfo> LIGetter = [this](const Function &F) {
360+
GetterTy<LoopInfo> LIGetter = [](const Function &F) {
361361
DominatorTree *DT = new DominatorTree(const_cast<Function &>(F));
362362
LoopInfo *LI = new LoopInfo(*DT);
363363
return LI;
364364
};
365-
GetterTy<PostDominatorTree> PDTGetter = [this](const Function &F) {
365+
GetterTy<PostDominatorTree> PDTGetter = [](const Function &F) {
366366
PostDominatorTree *PDT = new PostDominatorTree(const_cast<Function &>(F));
367367
return PDT;
368368
};

0 commit comments

Comments
 (0)