From 234fe654a3dd2888be42ae5db34db96c5c2c4ba3 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 5 Mar 2012 10:54:55 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152024 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ModuleBuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen/ModuleBuilder.cpp') diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index ddbe27bc17..f81f6236d6 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/lib/CodeGen/ModuleBuilder.cpp @@ -59,6 +59,10 @@ namespace { *M, *TD, Diags)); } + virtual void MarkVarRequired(VarDecl *VD) { + Builder->MarkVarRequired(VD); + } + virtual bool HandleTopLevelDecl(DeclGroupRef DG) { // Make sure to emit all elements of a Decl. for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) -- cgit v1.2.3