Line 0
Link Here
|
|
|
1 |
r291939 | malcolm.parsons | 2017-01-13 19:55:32 +0100 (Fri, 13 Jan 2017) | 1 line |
2 |
|
3 |
Remove unused lambda captures. NFC |
4 |
|
5 |
Index: tools/clang/lib/AST/CXXInheritance.cpp |
6 |
=================================================================== |
7 |
--- tools/clang/lib/AST/CXXInheritance.cpp (revision 291938) |
8 |
+++ tools/clang/lib/AST/CXXInheritance.cpp (revision 291939) |
9 |
@@ -88,7 +88,7 @@ bool CXXRecordDecl::isDerivedFrom(const CXXRecordD |
10 |
const CXXRecordDecl *BaseDecl = Base->getCanonicalDecl(); |
11 |
// FIXME: Capturing 'this' is a workaround for name lookup bugs in GCC 4.7. |
12 |
return lookupInBases( |
13 |
- [this, BaseDecl](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) { |
14 |
+ [BaseDecl](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) { |
15 |
return FindBaseClass(Specifier, Path, BaseDecl); |
16 |
}, |
17 |
Paths); |
18 |
@@ -109,7 +109,7 @@ bool CXXRecordDecl::isVirtuallyDerivedFrom(const C |
19 |
const CXXRecordDecl *BaseDecl = Base->getCanonicalDecl(); |
20 |
// FIXME: Capturing 'this' is a workaround for name lookup bugs in GCC 4.7. |
21 |
return lookupInBases( |
22 |
- [this, BaseDecl](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) { |
23 |
+ [BaseDecl](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) { |
24 |
return FindVirtualBaseClass(Specifier, Path, BaseDecl); |
25 |
}, |
26 |
Paths); |
27 |
Index: tools/clang/lib/AST/MicrosoftMangle.cpp |
28 |
=================================================================== |
29 |
--- tools/clang/lib/AST/MicrosoftMangle.cpp (revision 291938) |
30 |
+++ tools/clang/lib/AST/MicrosoftMangle.cpp (revision 291939) |
31 |
@@ -2997,7 +2997,7 @@ void MicrosoftMangleContextImpl::mangleStringLiter |
32 |
// N.B. The length is in terms of bytes, not characters. |
33 |
Mangler.mangleNumber(SL->getByteLength() + SL->getCharByteWidth()); |
34 |
|
35 |
- auto GetLittleEndianByte = [&Mangler, &SL](unsigned Index) { |
36 |
+ auto GetLittleEndianByte = [&SL](unsigned Index) { |
37 |
unsigned CharByteWidth = SL->getCharByteWidth(); |
38 |
uint32_t CodeUnit = SL->getCodeUnit(Index / CharByteWidth); |
39 |
unsigned OffsetInCodeUnit = Index % CharByteWidth; |
40 |
@@ -3004,7 +3004,7 @@ void MicrosoftMangleContextImpl::mangleStringLiter |
41 |
return static_cast<char>((CodeUnit >> (8 * OffsetInCodeUnit)) & 0xff); |
42 |
}; |
43 |
|
44 |
- auto GetBigEndianByte = [&Mangler, &SL](unsigned Index) { |
45 |
+ auto GetBigEndianByte = [&SL](unsigned Index) { |
46 |
unsigned CharByteWidth = SL->getCharByteWidth(); |
47 |
uint32_t CodeUnit = SL->getCodeUnit(Index / CharByteWidth); |
48 |
unsigned OffsetInCodeUnit = (CharByteWidth - 1) - (Index % CharByteWidth); |
49 |
Index: tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp |
50 |
=================================================================== |
51 |
--- tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp (revision 291938) |
52 |
+++ tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp (revision 291939) |
53 |
@@ -4006,8 +4006,8 @@ void CGOpenMPRuntime::emitTaskCall(CodeGenFunction |
54 |
DepTaskArgs[5] = CGF.Builder.getInt32(0); |
55 |
DepTaskArgs[6] = llvm::ConstantPointerNull::get(CGF.VoidPtrTy); |
56 |
} |
57 |
- auto &&ThenCodeGen = [this, Loc, &Data, TDBase, KmpTaskTQTyRD, |
58 |
- NumDependencies, &TaskArgs, |
59 |
+ auto &&ThenCodeGen = [this, &Data, TDBase, KmpTaskTQTyRD, NumDependencies, |
60 |
+ &TaskArgs, |
61 |
&DepTaskArgs](CodeGenFunction &CGF, PrePostActionTy &) { |
62 |
if (!Data.Tied) { |
63 |
auto PartIdFI = std::next(KmpTaskTQTyRD->field_begin(), KmpTaskTPartId); |
64 |
@@ -4562,7 +4562,7 @@ void CGOpenMPRuntime::emitReduction(CodeGenFunctio |
65 |
} |
66 |
if (XExpr) { |
67 |
auto *VD = cast<VarDecl>(cast<DeclRefExpr>(*ILHS)->getDecl()); |
68 |
- auto &&AtomicRedGen = [BO, VD, IPriv, |
69 |
+ auto &&AtomicRedGen = [BO, VD, |
70 |
Loc](CodeGenFunction &CGF, const Expr *XExpr, |
71 |
const Expr *EExpr, const Expr *UpExpr) { |
72 |
LValue X = CGF.EmitLValue(XExpr); |
73 |
@@ -4572,7 +4572,7 @@ void CGOpenMPRuntime::emitReduction(CodeGenFunctio |
74 |
CGF.EmitOMPAtomicSimpleUpdateExpr( |
75 |
X, E, BO, /*IsXLHSInRHSPart=*/true, |
76 |
llvm::AtomicOrdering::Monotonic, Loc, |
77 |
- [&CGF, UpExpr, VD, IPriv, Loc](RValue XRValue) { |
78 |
+ [&CGF, UpExpr, VD, Loc](RValue XRValue) { |
79 |
CodeGenFunction::OMPPrivateScope PrivateScope(CGF); |
80 |
PrivateScope.addPrivate( |
81 |
VD, [&CGF, VD, XRValue, Loc]() -> Address { |
82 |
@@ -5988,8 +5988,8 @@ void CGOpenMPRuntime::emitTargetCall(CodeGenFuncti |
83 |
OffloadError); |
84 |
|
85 |
// Fill up the pointer arrays and transfer execution to the device. |
86 |
- auto &&ThenGen = [&Ctx, &BasePointers, &Pointers, &Sizes, &MapTypes, Device, |
87 |
- OutlinedFnID, OffloadError, OffloadErrorQType, |
88 |
+ auto &&ThenGen = [&BasePointers, &Pointers, &Sizes, &MapTypes, Device, |
89 |
+ OutlinedFnID, OffloadError, |
90 |
&D](CodeGenFunction &CGF, PrePostActionTy &) { |
91 |
auto &RT = CGF.CGM.getOpenMPRuntime(); |
92 |
// Emit the offloading arrays. |
93 |
@@ -6275,8 +6275,8 @@ void CGOpenMPRuntime::emitTargetDataCalls( |
94 |
// Generate the code for the opening of the data environment. Capture all the |
95 |
// arguments of the runtime call by reference because they are used in the |
96 |
// closing of the region. |
97 |
- auto &&BeginThenGen = [&D, &CGF, Device, &Info, &CodeGen, &NoPrivAction]( |
98 |
- CodeGenFunction &CGF, PrePostActionTy &) { |
99 |
+ auto &&BeginThenGen = [&D, Device, &Info, &CodeGen](CodeGenFunction &CGF, |
100 |
+ PrePostActionTy &) { |
101 |
// Fill up the arrays with all the mapped variables. |
102 |
MappableExprsHandler::MapBaseValuesArrayTy BasePointers; |
103 |
MappableExprsHandler::MapValuesArrayTy Pointers; |
104 |
@@ -6322,8 +6322,7 @@ void CGOpenMPRuntime::emitTargetDataCalls( |
105 |
}; |
106 |
|
107 |
// Generate code for the closing of the data region. |
108 |
- auto &&EndThenGen = [&CGF, Device, &Info](CodeGenFunction &CGF, |
109 |
- PrePostActionTy &) { |
110 |
+ auto &&EndThenGen = [Device, &Info](CodeGenFunction &CGF, PrePostActionTy &) { |
111 |
assert(Info.isValid() && "Invalid data environment closing arguments."); |
112 |
|
113 |
llvm::Value *BasePointersArrayArg = nullptr; |
114 |
@@ -6401,7 +6400,7 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall |
115 |
"Expecting either target enter, exit data, or update directives."); |
116 |
|
117 |
// Generate the code for the opening of the data environment. |
118 |
- auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) { |
119 |
+ auto &&ThenGen = [&D, Device](CodeGenFunction &CGF, PrePostActionTy &) { |
120 |
// Fill up the arrays with all the mapped variables. |
121 |
MappableExprsHandler::MapBaseValuesArrayTy BasePointers; |
122 |
MappableExprsHandler::MapValuesArrayTy Pointers; |
123 |
Index: tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp |
124 |
=================================================================== |
125 |
--- tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp (revision 291938) |
126 |
+++ tools/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp (revision 291939) |
127 |
@@ -533,8 +533,7 @@ void CGOpenMPRuntimeNVPTX::emitGenericParallelCall |
128 |
ArrayRef<llvm::Value *> CapturedVars, const Expr *IfCond) { |
129 |
llvm::Function *Fn = cast<llvm::Function>(OutlinedFn); |
130 |
|
131 |
- auto &&L0ParallelGen = [this, Fn, &CapturedVars](CodeGenFunction &CGF, |
132 |
- PrePostActionTy &) { |
133 |
+ auto &&L0ParallelGen = [this, Fn](CodeGenFunction &CGF, PrePostActionTy &) { |
134 |
CGBuilderTy &Bld = CGF.Builder; |
135 |
|
136 |
// Prepare for parallel region. Indicate the outlined function. |
137 |
@@ -565,8 +564,8 @@ void CGOpenMPRuntimeNVPTX::emitGenericParallelCall |
138 |
|
139 |
auto &&SeqGen = [this, Fn, &CapturedVars, &Args](CodeGenFunction &CGF, |
140 |
PrePostActionTy &) { |
141 |
- auto &&CodeGen = [this, Fn, &CapturedVars, &Args](CodeGenFunction &CGF, |
142 |
- PrePostActionTy &Action) { |
143 |
+ auto &&CodeGen = [this, Fn, &CapturedVars](CodeGenFunction &CGF, |
144 |
+ PrePostActionTy &Action) { |
145 |
Action.Enter(CGF); |
146 |
|
147 |
llvm::SmallVector<llvm::Value *, 16> OutlinedFnArgs; |
148 |
Index: tools/clang/lib/CodeGen/CGStmtOpenMP.cpp |
149 |
=================================================================== |
150 |
--- tools/clang/lib/CodeGen/CGStmtOpenMP.cpp (revision 291938) |
151 |
+++ tools/clang/lib/CodeGen/CGStmtOpenMP.cpp (revision 291939) |
152 |
@@ -986,7 +986,7 @@ void CodeGenFunction::EmitOMPReductionClauseInit( |
153 |
OriginalBaseLValue); |
154 |
// Store the address of the original variable associated with the LHS |
155 |
// implicit variable. |
156 |
- PrivateScope.addPrivate(LHSVD, [this, OASELValueLB]() -> Address { |
157 |
+ PrivateScope.addPrivate(LHSVD, [OASELValueLB]() -> Address { |
158 |
return OASELValueLB.getAddress(); |
159 |
}); |
160 |
// Emit reduction copy. |
161 |
@@ -1040,9 +1040,8 @@ void CodeGenFunction::EmitOMPReductionClauseInit( |
162 |
*this, OrigVD->getType(), ASELValue.getType(), OriginalBaseLValue); |
163 |
// Store the address of the original variable associated with the LHS |
164 |
// implicit variable. |
165 |
- PrivateScope.addPrivate(LHSVD, [this, ASELValue]() -> Address { |
166 |
- return ASELValue.getAddress(); |
167 |
- }); |
168 |
+ PrivateScope.addPrivate( |
169 |
+ LHSVD, [ASELValue]() -> Address { return ASELValue.getAddress(); }); |
170 |
// Emit reduction copy. |
171 |
bool IsRegistered = PrivateScope.addPrivate( |
172 |
OrigVD, [this, OrigVD, PrivateVD, BaseLValue, ASELValue, |
173 |
@@ -2633,7 +2632,7 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(co |
174 |
for (const auto *C : S.getClausesOfKind<OMPDependClause>()) |
175 |
for (auto *IRef : C->varlists()) |
176 |
Data.Dependences.push_back(std::make_pair(C->getDependencyKind(), IRef)); |
177 |
- auto &&CodeGen = [PartId, &S, &Data, CS, &BodyGen, &LastprivateDstsOrigs]( |
178 |
+ auto &&CodeGen = [&Data, CS, &BodyGen, &LastprivateDstsOrigs]( |
179 |
CodeGenFunction &CGF, PrePostActionTy &Action) { |
180 |
// Set proper addresses for generated private copies. |
181 |
OMPPrivateScope Scope(CGF); |
182 |
@@ -3250,7 +3249,7 @@ static void EmitOMPAtomicCaptureExpr(CodeGenFuncti |
183 |
NewVValType = XRValExpr->getType(); |
184 |
auto *ERValExpr = IsXLHSInRHSPart ? RHS : LHS; |
185 |
auto &&Gen = [&CGF, &NewVVal, UE, ExprRValue, XRValExpr, ERValExpr, |
186 |
- IsSeqCst, IsPostfixUpdate](RValue XRValue) -> RValue { |
187 |
+ IsPostfixUpdate](RValue XRValue) -> RValue { |
188 |
CodeGenFunction::OpaqueValueMapping MapExpr(CGF, ERValExpr, ExprRValue); |
189 |
CodeGenFunction::OpaqueValueMapping MapX(CGF, XRValExpr, XRValue); |
190 |
RValue Res = CGF.EmitAnyExpr(UE); |
191 |
@@ -3277,7 +3276,7 @@ static void EmitOMPAtomicCaptureExpr(CodeGenFuncti |
192 |
NewVValType = X->getType().getNonReferenceType(); |
193 |
ExprRValue = convertToType(CGF, ExprRValue, E->getType(), |
194 |
X->getType().getNonReferenceType(), Loc); |
195 |
- auto &&Gen = [&CGF, &NewVVal, ExprRValue](RValue XRValue) -> RValue { |
196 |
+ auto &&Gen = [&NewVVal, ExprRValue](RValue XRValue) -> RValue { |
197 |
NewVVal = XRValue; |
198 |
return ExprRValue; |
199 |
}; |