summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-01-18 01:50:35 +0000
committerNico Weber <nicolasweber@gmx.de>2015-01-18 01:50:35 +0000
commit7a92e1ad3d44d2e0528d6cd5c1e99fc34a8acf2b (patch)
treee02902499fa44ad0b2f9371358bb9f1f1f791500 /clang/lib
parent01fb5fb1287552ececa992ae60062ae045a1bc5e (diff)
downloadbcm5719-llvm-7a92e1ad3d44d2e0528d6cd5c1e99fc34a8acf2b.tar.gz
bcm5719-llvm-7a92e1ad3d44d2e0528d6cd5c1e99fc34a8acf2b.zip
Address review feedback from r215780: Use a flag insteda of the heap. No behavior change.
llvm-svn: 226389
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 40e86175b2c..1df0701ee9f 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -3313,12 +3313,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
// it marks vtables used in late parsed templates as used.
SavePendingLocalImplicitInstantiationsRAII
SavedPendingLocalImplicitInstantiations(*this);
- std::unique_ptr<SavePendingInstantiationsAndVTableUsesRAII>
- SavePendingInstantiationsAndVTableUses;
- if (Recursive) {
- SavePendingInstantiationsAndVTableUses.reset(
- new SavePendingInstantiationsAndVTableUsesRAII(*this));
- }
+ SavePendingInstantiationsAndVTableUsesRAII
+ SavePendingInstantiationsAndVTableUses(*this, /*Enabled=*/Recursive);
// Call the LateTemplateParser callback if there is a need to late parse
// a templated function definition.
@@ -3463,8 +3459,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
// instantiation of this template.
PerformPendingInstantiations();
- // Restore PendingInstantiations and VTableUses.
- SavePendingInstantiationsAndVTableUses.reset();
+ // PendingInstantiations and VTableUses are restored through
+ // SavePendingInstantiationsAndVTableUses's destructor.
}
}
@@ -3780,12 +3776,8 @@ void Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation,
// If we're performing recursive template instantiation, create our own
// queue of pending implicit instantiations that we will instantiate
// later, while we're still within our own instantiation context.
- std::unique_ptr<SavePendingInstantiationsAndVTableUsesRAII>
- SavePendingInstantiationsAndVTableUses;
- if (Recursive) {
- SavePendingInstantiationsAndVTableUses.reset(
- new SavePendingInstantiationsAndVTableUsesRAII(*this));
- }
+ SavePendingInstantiationsAndVTableUsesRAII
+ SavePendingInstantiationsAndVTableUses(*this, /*Enabled=*/Recursive);
LocalInstantiationScope Local(*this);
@@ -3812,8 +3804,8 @@ void Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation,
// instantiation of this template.
PerformPendingInstantiations();
- // Restore PendingInstantiations and VTableUses.
- SavePendingInstantiationsAndVTableUses.reset();
+ // PendingInstantiations and VTableUses are restored through
+ // SavePendingInstantiationsAndVTableUses's destructor.
}
}
@@ -3899,12 +3891,8 @@ void Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation,
// while we're still within our own instantiation context.
SavePendingLocalImplicitInstantiationsRAII
SavedPendingLocalImplicitInstantiations(*this);
- std::unique_ptr<SavePendingInstantiationsAndVTableUsesRAII>
- SavePendingInstantiationsAndVTableUses;
- if (Recursive) {
- SavePendingInstantiationsAndVTableUses.reset(
- new SavePendingInstantiationsAndVTableUsesRAII(*this));
- }
+ SavePendingInstantiationsAndVTableUsesRAII
+ SavePendingInstantiationsAndVTableUses(*this, /*Enabled=*/Recursive);
// Enter the scope of this instantiation. We don't use
// PushDeclContext because we don't have a scope.
@@ -3970,8 +3958,8 @@ void Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation,
// instantiation of this template.
PerformPendingInstantiations();
- // Restore PendingInstantiations and VTableUses.
- SavePendingInstantiationsAndVTableUses.reset();
+ // PendingInstantiations and VTableUses are restored through
+ // SavePendingInstantiationsAndVTableUses's destructor.
}
}
OpenPOWER on IntegriCloud