[PATCH] D32092: Attribute inline

2017-04-14 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. From some very superficial testing, it looks like CL treats `__declspec(inline)` exactly like a synonym for `inline` (it even rejects them both appearing on the same declaration, complaining about a duplicate `inline` specifier). So modeling this as `GNUInlineAttr` is de

[PATCH] D32092: Attribute inline

2017-04-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D32092#727559, @zahiraam wrote: > Yes I did compare "inline" with "declspec(inline)" and not with > "__attribute((gnu_inline))" and didn't test it whit different specifiers. I > can do that. > If behavior is different we probably hav

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. Yes I did compare "inline" with "declspec(inline)" and not with "__attribute((gnu_inline))" and didn't test it whit different specifiers. I can do that. If behavior is different we probably have to add an additional attribute? https://reviews.llvm.org/D32092

[PATCH] D32092: Attribute inline

2017-04-14 Thread Richard Smith via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D32092#727543, @zahiraam wrote: > Pushed the submit too fast ... > Before I submitted this review, I have done some experiments and inline and > declspec(inline) have the same behavior. Compiling with /Ob0 disables > inlining. With -O1 or -O2

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. Pushed the submit too fast ... Before I submitted this review, I have done some experiments and inline and declspec(inline) have the same behavior. Compiling with /Ob0 disables inlining. With -O1 or -O2, inline happens. https://reviews.llvm.org/D32092 _

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. Yes it behaves the same way than the Gnu inline. https://reviews.llvm.org/D32092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32092: Attribute inline

2017-04-14 Thread Richard Smith via Phabricator via cfe-commits
rsmith added inline comments. Comment at: include/clang/Basic/Attr.td:869 def GNUInline : InheritableAttr { - let Spellings = [GCC<"gnu_inline">]; + let Spellings = [GCC<"gnu_inline">, Declspec<"inline">]; let Subjects = SubjectList<[Function]>; aaron.ballm

[PATCH] D32092: Attribute inline

2017-04-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D32092#727518, @zahiraam wrote: > Forgot to mention that this is for C only. CL doesn't compile this > declaration in a C++ context. > Please see: > https://godbolt.org/g/WRhyjL Oh, that's fun. It's not at all clear that this isn't

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. Forgot to mention that this is for C only. CL doesn't compile this declaration in a C++ context. Please see: https://godbolt.org/g/WRhyjL https://reviews.llvm.org/D32092 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D32092: Attribute inline

2017-04-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D32092#727507, @zahiraam wrote: > ksh-3.2$ cat test3.c > static void __declspec(inline) foo() { > } > > int main() > { > > foo(); > > } > > ksh-3.2$ cl test3.c > Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. ksh-3.2$ cat test3.c static void __declspec(inline) foo() { } int main() { foo(); } ksh-3.2$ cl test3.c Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved. test3.c Microsoft (R) Incrementa

[PATCH] D32092: Attribute inline

2017-04-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:869 def GNUInline : InheritableAttr { - let Spellings = [GCC<"gnu_inline">]; + let Spellings = [GCC<"gnu_inline">, Declspec<"inline">]; let Subjects = SubjectList<[Function]>; I ca

[PATCH] D32092: Attribute inline

2017-04-14 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam created this revision. Added support for attribute inline for a __declspec declaration. https://reviews.llvm.org/D32092 Files: include/clang/Basic/Attr.td lib/Parse/ParseDecl.cpp lib/Sema/SemaDeclAttr.cpp test/Sema/declspec-inline.c test\Sema\declspec-inline.c Index: lib/Pa