From 189fa748ec9e05820f7c5df8ff00aa3c7bc0546c 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. llvm-svn: 152024 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 922a5df344f..b2bfab055b6 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1722,6 +1722,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, } } +void CodeGenModule::MarkVarRequired(VarDecl *VD) { + GetAddrOfGlobalVar(VD); +} void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) { const FunctionDecl *D = cast(GD.getDecl()); -- cgit v1.2.3