aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-31 07:58:42 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-31 07:58:42 +0000
commit8155910a192dafa423d6b932b7d127d48e4641e8 (patch)
treec017b6c08b20cc3de7bdb7c111cfad2d2bad95aa /lib/Sema/Sema.cpp
parentcca1ea7a69bd29bd9ef78a679c8404a98aa4476e (diff)
Whenever we instantiate a static data member, make sure to define any new
vtables! Fixes PR10020 This also allows us to revert the part of r130023 which added a big loop around the template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 6ca8be2999..8297b3155a 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -378,30 +378,22 @@ void Sema::ActOnEndOfTranslationUnit() {
}
}
- bool SomethingChanged;
- do {
- SomethingChanged = false;
-
- // If DefinedUsedVTables ends up marking any virtual member functions it
- // might lead to more pending template instantiations, which we then need
- // to instantiate.
- if (DefineUsedVTables())
- SomethingChanged = true;
-
- // C++: Perform implicit template instantiations.
- //
- // FIXME: When we perform these implicit instantiations, we do not
- // carefully keep track of the point of instantiation (C++ [temp.point]).
- // This means that name lookup that occurs within the template
- // instantiation will always happen at the end of the translation unit,
- // so it will find some names that should not be found. Although this is
- // common behavior for C++ compilers, it is technically wrong. In the
- // future, we either need to be able to filter the results of name lookup
- // or we need to perform template instantiations earlier.
- if (PerformPendingInstantiations())
- SomethingChanged = true;
-
- } while (SomethingChanged);
+ // If DefinedUsedVTables ends up marking any virtual member functions it
+ // might lead to more pending template instantiations, which we then need
+ // to instantiate.
+ DefineUsedVTables();
+
+ // C++: Perform implicit template instantiations.
+ //
+ // FIXME: When we perform these implicit instantiations, we do not
+ // carefully keep track of the point of instantiation (C++ [temp.point]).
+ // This means that name lookup that occurs within the template
+ // instantiation will always happen at the end of the translation unit,
+ // so it will find some names that should not be found. Although this is
+ // common behavior for C++ compilers, it is technically wrong. In the
+ // future, we either need to be able to filter the results of name lookup
+ // or we need to perform template instantiations earlier.
+ PerformPendingInstantiations();
}
// Remove file scoped decls that turned out to be used.