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
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
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
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
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
_
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
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
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
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.
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
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
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
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
13 matches
Mail list logo