This is an archive of the discontinued LLVM Phabricator instance.

Enable recognition of __declspec for PS4
AbandonedPublic

Authored by wristow on Jul 14 2015, 4:36 PM.

Details

Reviewers
asl
Summary

This change includes the changes of reviews.llvm.org/D11164 (reserving a flag for Sony/PS extensions), and also uses that flag to enable recognition of __declspec. This supersedes D11164.

Can someone review, and if OK then commit this patch for me, please?

-Warren Ristow
SN Systems - Sony Computer Entertainment Group

Diff Detail

Event Timeline

wristow updated this revision to Diff 29732.Jul 14 2015, 4:36 PM
wristow retitled this revision from to Enable recognition of __declspec for PS4.
wristow updated this object.
wristow added a reviewer: asl.
wristow added a subscriber: cfe-commits.

Can I get a brief description of what you're trying to accomplish and
why this is needed?

We intend to support declspec(dllimport)/declspec(dllexport) on PS4, and we will be uploading code reviews for that. So we're enabling recognition of __declspec on PS4 as a prerequisite for that.

-Warren

rnk added a subscriber: rnk.Jul 15 2015, 11:28 AM

Seems reasonable.

include/clang/Basic/LangOptions.def
81

How do you guys feel about "sony" vs. "sce"? I know we abbreviated Microsoft to MS, but I think a lot of folks don't know that the full name of the particular company involved is "Sony Computer Entertainment". If -fsce-extensions is already used in build systems, I'm OK leaving the flag as is. I'm mostly concerned with SceExt.

wristow added inline comments.Jul 15 2015, 3:05 PM
include/clang/Basic/LangOptions.def
81

We do already have '-target x86_64-scei-ps4', and we have other pending changes that use 'sce' (rather than 'scei') that I expect will appear very soon. So we (Sony) are leaning toward continuing with 'sce'.

silvas added a subscriber: silvas.Jul 15 2015, 3:11 PM
silvas added inline comments.
include/clang/Basic/LangOptions.def
81

"Sony" is way too broad. The company "Sony" does everything from image sensors to banking & insurance to lithium batteries to public transit turnstiles to laparoscopic surgery equipment. We don't represent the entire company "Sony", nor is there any reason to believe that anything we are doing applies to "Sony" as a whole.

Sony would like support for declspec without turning on all MS
extensions. We currently have the same idea in place to support
declspec for CUDA. It seems to me that there are cases where
unconditional support of declspec is desired. I am wondering if we
want an -fdeclspec-ext (or something) that enables just
declspec
support, instead of trying to tie this extension to compiler vendors.
Obviously, we could turn this extension on for Sony's triple as well
in that case. I'm wondering if that's a design we'd want to consider
exploring or not.

Yes, and to be clear, it also is not _only_ '__declspec' that we (Sony) want to enable. Hence the idea of the '-fsce-extensions' approach.

But that said, the set of extensions we want to enable is not large, so the approach of '-fdeclspec-ext' is attractive. With that in mind, I'll re-implement this concept.

Thanks all.

-Warren

dberlin added inline comments.
include/clang/Basic/LangOptions.def
81

Please don't use (R) here. It should be unnecessary (and we don't do it for others).

rnk added inline comments.Jul 17 2015, 10:20 AM
include/clang/Basic/LangOptions.def
81

Sounds like it's going to be SCE, then. Would it be accurate to put "Sony Computer Entertainment extensions" in the comment, since that's what's being abbreviated?

ygao added a subscriber: ygao.Jul 17 2015, 2:01 PM
ygao added inline comments.
include/clang/Basic/LangOptions.def
81

Makese sense. Although if Aaron's -fdeclspec idea goes through, we may not need the separate fsce-ext flag.
Ref: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150713/133372.html

I imagine that at some point MinGW will also want the __declspec keyword available, even though they try to use the GNU side of things. There are minor differences in __attribute__ vs __declspec, primarily involved in where they may be placed. I think that having the -fdeclspec-ext sounds much more favorable, unless we intend to have a number of additional extension environments, which seems a bit unnecessary.

wristow abandoned this revision.Sep 30 2015, 6:44 PM

This has been superseded by D13322.