Bug 28069 - Add inline to help winscw compiler resolve specialized argument in templated functions.
Summary: Add inline to help winscw compiler resolve specialized argument in templated ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: S60 Emulator S60 3rd edition
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt
Depends on:
Blocks: 27065
  Show dependency treegraph
 
Reported: 2009-08-07 08:15 PDT by Yongjun Zhang
Modified: 2009-08-07 13:15 PDT (History)
2 users (show)

See Also:


Attachments
Add inline to help winscw compiler resolve specialized argument in templated functions. (1.38 KB, patch)
2009-08-07 09:03 PDT, Yongjun Zhang
eric: review-
Details | Formatted Diff | Diff
Modified patch as per Eric's comments. (1.45 KB, patch)
2009-08-07 10:46 PDT, Yongjun Zhang
eric: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.