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
This commit is contained in:
Rafael Espindola
2012-03-05 10:54:55 +00:00
parent 08a47fd708
commit 189fa748ec
9 changed files with 49 additions and 4 deletions

View File

@@ -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<FunctionDecl>(GD.getDecl());