[cfe-commits] patch: redeclaring an inline function external should trigger emission

Douglas Gregor dgregor at apple.com
Wed Jul 6 15:39:53 PDT 2011


On Jul 6, 2011, at 1:08 PM, Nick Lewycky wrote:

> The attached patch fixes PR10233 and is also available for review on http://codereview.appspot.com/4634122/ as well as being attached.
> 
> The problem is that codegen knows it doesn't need to emit the inline function when it first encounters it, then when it sees the redeclaration it sees no definition on it and ignores that. The fix works by double-checking on each redeclaration (in C99 mode without gnu inline semantics) that this isn't the first redecl of an inline method. If it is, then we remove it from DeferredDecls (it won't be in DeferredDeclsToEmit), and emit it immediately.
> 
> Please review!

The added code in ASTContext.cpp and CodeGenModule.cpp is basically the same. How about abstracting this into a Decl or ASTContext routine "doesFunctionDeclatationForceExternallyVisibleDefinition()" (or something less long-winded)?

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110706/5241cf5e/attachment.html>


More information about the cfe-commits mailing list