[llvm] 82e594a - [AMDGPU] Remove unused lambda capture in AMDGPUMCResourceInfo.cpp (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 04:08:42 PDT 2024


Author: Jie Fu
Date: 2024-09-30T19:07:42+08:00
New Revision: 82e594a022d3f3e19ba22dfc55349fe97ed844e6

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

LOG: [AMDGPU] Remove unused lambda capture in AMDGPUMCResourceInfo.cpp (NFC)

/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp:26:16:
error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto GOCS = [this, FuncName, &OutContext](StringRef Suffix) {
               ^~~~~
/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp:64:27:
error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto assignMaxRegSym = [this, &OutContext](MCSymbol *Sym, int32_t RegCount) {
                          ^~~~~
2 errors generated.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
index b5f53290eff3ac..f608a9a4f470fa 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
@@ -23,7 +23,7 @@ using namespace llvm;
 
 MCSymbol *MCResourceInfo::getSymbol(StringRef FuncName, ResourceInfoKind RIK,
                                     MCContext &OutContext) {
-  auto GOCS = [this, FuncName, &OutContext](StringRef Suffix) {
+  auto GOCS = [FuncName, &OutContext](StringRef Suffix) {
     return OutContext.getOrCreateSymbol(FuncName + Twine(Suffix));
   };
   switch (RIK) {
@@ -61,7 +61,7 @@ void MCResourceInfo::assignMaxRegs(MCContext &OutContext) {
   MCSymbol *MaxAGPRSym = getMaxAGPRSymbol(OutContext);
   MCSymbol *MaxSGPRSym = getMaxSGPRSymbol(OutContext);
 
-  auto assignMaxRegSym = [this, &OutContext](MCSymbol *Sym, int32_t RegCount) {
+  auto assignMaxRegSym = [&OutContext](MCSymbol *Sym, int32_t RegCount) {
     const MCExpr *MaxExpr = MCConstantExpr::create(RegCount, OutContext);
     Sym->setVariableValue(MaxExpr);
   };


        


More information about the llvm-commits mailing list