Bug 28069

Summary: Add inline to help winscw compiler resolve specialized argument in templated functions.
Product: WebKit Reporter: Yongjun Zhang <yongjun.zhang>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: S60 Emulator   
OS: S60 3rd edition   
Bug Depends on:    
Bug Blocks: 27065    
Attachments:
Description Flags
Add inline to help winscw compiler resolve specialized argument in templated functions.
eric: review-
Modified patch as per Eric's comments. eric: commit-queue+

Description Yongjun Zhang 2009-08-07 08:15:51 PDT
Wiscw compiler cannot resolve template argument "mode" from the following code:

----------------------------------------------------
template <int mode> void test_function()
{
    int m = mode; // it complains mode is not defined
}
----------------------------------------------------

If we inline this function, the compiler won't report the error.
Comment 1 Yongjun Zhang 2009-08-07 09:03:07 PDT
Created attachment 34281 [details]
Add inline to help winscw compiler resolve specialized argument in templated functions.

The inline is only enabled for winscw compiler; for other compilers, it will be disabled to avoid increasing the binary size.
Comment 2 Eric Seidel (no email) 2009-08-07 09:04:57 PDT
Comment on attachment 34281 [details]
Add inline to help winscw compiler resolve specialized argument in templated functions.

I don't see why this can't be inline for all compilers.  "inline" is a hint anyway.  Compilers can (and will) ignore it.
Comment 3 Eric Seidel (no email) 2009-08-07 09:05:37 PDT
you could add a comment about how "inline" is required there to help the winscw compiler if you like.
Comment 4 Yongjun Zhang 2009-08-07 10:46:18 PDT
Created attachment 34292 [details]
Modified patch as per Eric's comments.

Thanks for the quick review.

The new patch removes winscw compiler specific flag.
Comment 5 Eric Seidel (no email) 2009-08-07 10:49:35 PDT
Comment on attachment 34292 [details]
Modified patch as per Eric's comments.

LGTM.
Comment 6 Adam Barth 2009-08-07 13:15:50 PDT
Comment on attachment 34292 [details]
Modified patch as per Eric's comments.

Clearing review flag on attachment: 34292

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/runtime/LiteralParser.cpp
Committed r46910
	M	LayoutTests/platform/mac/Skipped
	M	LayoutTests/platform/win/Skipped
	M	LayoutTests/ChangeLog
r46909 = b66fe77cc3bbc2d501a8b5d5a3fc7dd3d62d7df0 (trunk)
	M	JavaScriptCore/runtime/LiteralParser.cpp
	M	JavaScriptCore/ChangeLog
r46910 = 0fc235ef070baf8ffb224dc034ba71c824933021 (trunk)
First, rewinding head to replay your work on top of it...
Nothing to do.
http://trac.webkit.org/changeset/46910
Comment 7 Adam Barth 2009-08-07 13:15:55 PDT
All reviewed patches have been landed.  Closing bug.