mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Make use of C++11 range-based for
Should be available now that support for LLVM < 3.5 has been dropped.
This commit is contained in:
parent
3d803c7a1c
commit
2d959ea540
34 changed files with 182 additions and 335 deletions
|
@ -377,12 +377,8 @@ static void DtoCreateNestedContextType(FuncDeclaration* fd)
|
|||
|
||||
// Add the direct nested variables of this function, and update their indices to match.
|
||||
// TODO: optimize ordering for minimal space usage?
|
||||
for (VarDeclarations::iterator I = fd->closureVars.begin(),
|
||||
E = fd->closureVars.end();
|
||||
I != E; ++I)
|
||||
for (auto vd : fd->closureVars)
|
||||
{
|
||||
VarDeclaration* vd = *I;
|
||||
|
||||
unsigned alignment = DtoAlignment(vd);
|
||||
if (alignment > 1)
|
||||
builder.alignCurrentOffset(alignment);
|
||||
|
@ -508,11 +504,7 @@ void DtoCreateNestedContext(FuncDeclaration* fd) {
|
|||
irfunction->nestedVar = frame;
|
||||
|
||||
// go through all nested vars and assign addresses where possible.
|
||||
for (VarDeclarations::iterator I = fd->closureVars.begin(),
|
||||
E = fd->closureVars.end();
|
||||
I != E; ++I) {
|
||||
VarDeclaration *vd = *I;
|
||||
|
||||
for (auto vd : fd->closureVars) {
|
||||
if (needsClosure && vd->needsAutoDtor()) {
|
||||
// This should really be a front-end, not a glue layer error,
|
||||
// but we need to fix this in DMD too.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue