diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-05 10:54:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-05 10:54:55 +0000 |
commit | 189fa748ec9e05820f7c5df8ff00aa3c7bc0546c (patch) | |
tree | 20583052017fe002b904ee90abb1f5cde9e6a733 /clang/lib/Frontend/MultiplexConsumer.cpp | |
parent | 08a47fd708680fc67f8c1c80f64379b35d6f472c (diff) | |
download | llvm-189fa748ec9e05820f7c5df8ff00aa3c7bc0546c.zip llvm-189fa748ec9e05820f7c5df8ff00aa3c7bc0546c.tar.gz llvm-189fa748ec9e05820f7c5df8ff00aa3c7bc0546c.tar.bz2 |
Fix a small difference in sema and codegen views of what needs to be output.
In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.
This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.
llvm-svn: 152024
Diffstat (limited to 'clang/lib/Frontend/MultiplexConsumer.cpp')
-rw-r--r-- | clang/lib/Frontend/MultiplexConsumer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp index cef4590..a1d1156 100644 --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/lib/Frontend/MultiplexConsumer.cpp @@ -209,6 +209,11 @@ bool MultiplexConsumer::HandleTopLevelDecl(DeclGroupRef D) { return Continue; } +void MultiplexConsumer::MarkVarRequired(VarDecl *VD) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->MarkVarRequired(VD); +} + void MultiplexConsumer::HandleInterestingDecl(DeclGroupRef D) { for (size_t i = 0, e = Consumers.size(); i != e; ++i) Consumers[i]->HandleInterestingDecl(D); |