Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-02-04 Thread Doerfert, Johannes via cfe-commits
Should be fixed in r353088 (git c3707cc5d91). Can you verify it now is as you 
expect it?

From: Eli Friedman 
Sent: Thursday, January 31, 2019 18:17
To: Doerfert, Johannes; Chandler Carruth; cfe-commits@lists.llvm.org
Cc: Raja Venkateswaran
Subject: RE: r351629 - Emit !callback metadata and introduce the callback 
attribute

(Comments inline.)

> -Original Message-
> From: cfe-commits  On Behalf Of
> Doerfert, Johannes Rudolf via cfe-commits
> Sent: Tuesday, January 22, 2019 9:29 AM
> To: Chandler Carruth 
> Cc: cfe-commits cfe 
> Subject: Re: r351629 - Emit !callback metadata and introduce the callback
> attribute
>
> > Another thing I notecide is that this code assumes the system has
> > `pthread.h` -- what about systems without it? I mean, you can disable the
> > test, but it seems bad to lose test coverage just because of that.
>
> So far, I disabled the test with a later addition which makes sure this
> test is only run under Linux. I'm unsure why we loose coverage because
> of that?

There isn't any way to safely disable the test without disabling it everywhere. 
 Specifically, the current version requires both that the host is Unix, and 
that the default target is the host.  Otherwise, the compiler might not be able 
to find and/or build pthread.h .

>
> > I would much prefer that you provide your own stub `pthread.h` in the
> > Inputs/... tree of the test suite and use that to test this in a portable
> > way.
>
> I do not completely follow but I'm open to improving the test. Basically
> I have to make sure the builtin recognition will trigger on the header
> file and the contained declaration. If we can somehow do this in a
> portable way I'm all for it. Is that how we test other builtin gnu extensions?

You don't need a header file; clang doesn't actually care where the builtin is 
declared.  You can just write "void pthread_create(void*,void*,void*(void*), 
void*);" or whatever directly in the C file.  It'll trigger a warning, but with 
your patch, there's no way to declare pthread_create without triggering a 
warning, so that hardly matters.

On a related note, code generation tests should use %clang_cc1.  Among other 
things, this avoids accidentally including headers from the host system.

-Eli

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-31 Thread Doerfert, Johannes via cfe-commits
Thanks for the clarifications. I'll fix all mentioned points asap.


From: Eli Friedman 
Sent: Thursday, January 31, 2019 18:17
To: Doerfert, Johannes; Chandler Carruth; cfe-commits@lists.llvm.org
Cc: Raja Venkateswaran
Subject: RE: r351629 - Emit !callback metadata and introduce the callback 
attribute

(Comments inline.)

> -Original Message-
> From: cfe-commits  On Behalf Of
> Doerfert, Johannes Rudolf via cfe-commits
> Sent: Tuesday, January 22, 2019 9:29 AM
> To: Chandler Carruth 
> Cc: cfe-commits cfe 
> Subject: Re: r351629 - Emit !callback metadata and introduce the callback
> attribute
>
> > Another thing I notecide is that this code assumes the system has
> > `pthread.h` -- what about systems without it? I mean, you can disable the
> > test, but it seems bad to lose test coverage just because of that.
>
> So far, I disabled the test with a later addition which makes sure this
> test is only run under Linux. I'm unsure why we loose coverage because
> of that?

There isn't any way to safely disable the test without disabling it everywhere. 
 Specifically, the current version requires both that the host is Unix, and 
that the default target is the host.  Otherwise, the compiler might not be able 
to find and/or build pthread.h .

>
> > I would much prefer that you provide your own stub `pthread.h` in the
> > Inputs/... tree of the test suite and use that to test this in a portable
> > way.
>
> I do not completely follow but I'm open to improving the test. Basically
> I have to make sure the builtin recognition will trigger on the header
> file and the contained declaration. If we can somehow do this in a
> portable way I'm all for it. Is that how we test other builtin gnu extensions?

You don't need a header file; clang doesn't actually care where the builtin is 
declared.  You can just write "void pthread_create(void*,void*,void*(void*), 
void*);" or whatever directly in the C file.  It'll trigger a warning, but with 
your patch, there's no way to declare pthread_create without triggering a 
warning, so that hardly matters.

On a related note, code generation tests should use %clang_cc1.  Among other 
things, this avoids accidentally including headers from the host system.

-Eli

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


RE: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-31 Thread Eli Friedman via cfe-commits
(Comments inline.)

> -Original Message-
> From: cfe-commits  On Behalf Of
> Doerfert, Johannes Rudolf via cfe-commits
> Sent: Tuesday, January 22, 2019 9:29 AM
> To: Chandler Carruth 
> Cc: cfe-commits cfe 
> Subject: Re: r351629 - Emit !callback metadata and introduce the callback
> attribute
> 
> > Another thing I notecide is that this code assumes the system has
> > `pthread.h` -- what about systems without it? I mean, you can disable the
> > test, but it seems bad to lose test coverage just because of that.
> 
> So far, I disabled the test with a later addition which makes sure this
> test is only run under Linux. I'm unsure why we loose coverage because
> of that?

There isn't any way to safely disable the test without disabling it everywhere. 
 Specifically, the current version requires both that the host is Unix, and 
that the default target is the host.  Otherwise, the compiler might not be able 
to find and/or build pthread.h .

> 
> > I would much prefer that you provide your own stub `pthread.h` in the
> > Inputs/... tree of the test suite and use that to test this in a portable
> > way.
> 
> I do not completely follow but I'm open to improving the test. Basically
> I have to make sure the builtin recognition will trigger on the header
> file and the contained declaration. If we can somehow do this in a
> portable way I'm all for it. Is that how we test other builtin gnu extensions?

You don't need a header file; clang doesn't actually care where the builtin is 
declared.  You can just write "void pthread_create(void*,void*,void*(void*), 
void*);" or whatever directly in the C file.  It'll trigger a warning, but with 
your patch, there's no way to declare pthread_create without triggering a 
warning, so that hardly matters.

On a related note, code generation tests should use %clang_cc1.  Among other 
things, this avoids accidentally including headers from the host system.

-Eli 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-22 Thread Doerfert, Johannes Rudolf via cfe-commits
On 01/22, Chandler Carruth wrote:
> On Sat, Jan 19, 2019 at 2:18 AM Johannes Doerfert via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
> 
> > Author: jdoerfert
> > Date: Fri Jan 18 21:36:54 2019
> > New Revision: 351629
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=351629=rev
> > Log:
> > Emit !callback metadata and introduce the callback attribute
> >
> >   With commit r351627, LLVM gained the ability to apply (existing) IPO
> >   optimizations on indirections through callbacks, or transitive calls.
> >   The general idea is that we use an abstraction to hide the middle man
> >   and represent the callback call in the context of the initial caller.
> >   It is described in more detail in the commit message of the LLVM patch
> >   r351627, the llvm::AbstractCallSite class description, and the
> >   language reference section on callback-metadata.
> >
> >   This commit enables clang to emit !callback metadata that is
> >   understood by LLVM. It does so in three different cases:
> > 1) For known broker functions declarations that are directly
> >generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
> > 2) For known broker functions that are identified by their name and
> >source location through the builtin detection, e.g.,
> >pthread_create from the POSIX thread API.
> > 3) For user annotated functions that carry the "callback(callee, ...)"
> >attribute. The attribute has to include the name, or index, of
> >the callback callee and how the passed arguments can be
> >identified (as many as the callback callee has). See the callback
> >attribute documentation for detailed information.
> >
> > Differential Revision: https://reviews.llvm.org/D55483
> >
> > Added: cfe/trunk/test/Sema/attr-callback-broken.c
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-callback-broken.c?rev=351629=auto
> >
> > ==
> > --- cfe/trunk/test/Sema/attr-callback-broken.c (added)
> > +++ cfe/trunk/test/Sema/attr-callback-broken.c Fri Jan 18 21:36:54 2019
> > @@ -0,0 +1,75 @@
> > +// RUN: %clang_cc1 %s -verify -fsyntax-only
> > +
> > +__attribute__((callback())) void no_callee(void (*callback)(void)); //
> > expected-error {{'callback' attribute specifies no callback callee}}
> > +
> > +__attribute__((callback(1, 1))) void too_many_args_1(void
> > (*callback)(void)) {}  // expected-error {{'callback' attribute takes
> > one argument}}
> > +__attribute__((callback(1, -1))) void too_many_args_2(double
> > (*callback)(void)); // expected-error {{'callback' attribute takes one
> > argument}}
> > +__attribute__((callback(1, 2, 2))) void too_many_args_3(void
> > (*callback)(int), int); // expected-error {{'callback' attribute requires
> > exactly 2 arguments}}
> > +
> > +__attribute__((callback(1, 2))) void too_few_args_1(void (*callback)(int,
> > int), int); // expected-error {{'callback' attribute takes one argument}}
> > +__attribute__((callback(1))) void too_few_args_2(int (*callback)(int));
> >  // expected-error {{'callback' attribute takes no arguments}}
> > +__attribute__((callback(1, -1))) void too_few_args_3(void
> > (*callback)(int, int)) {}   // expected-error {{'callback' attribute takes
> > one argument}}
> > +
> > +__attribute__((callback(-1))) void oob_args_1(void (*callback)(void));
> >  // expected-error {{'callback' attribute specifies invalid callback
> > callee}}
> > +__attribute__((callback(2))) void oob_args_2(int *(*callback)(void)) {}
> >   // expected-error {{'callback' attribute parameter 1 is out of
> > bounds}}
> > +__attribute__((callback(1, 3))) void oob_args_3(short (*callback)(int),
> > int);  // expected-error {{'callback' attribute parameter 2 is out of
> > bounds}}
> > +__attribute__((callback(-2, 2))) void oob_args_4(void *(*callback)(int),
> > int); // expected-error {{'callback' attribute parameter 1 is out of
> > bounds}}
> > +__attribute__((callback(1, -2))) void oob_args_5(void *(*callback)(int),
> > int); // expected-error {{'callback' attribute parameter 2 is out of
> > bounds}}
> > +__attribute__((callback(1, 2))) void oob_args_6(void *(*callback)(int),
> > ...);  // expected-error {{'callback' attribute parameter 2 is out of
> > bounds}}
> > +
> > +__attribute__((callback(1))) __attribute__((callback(1))) void
> > multiple_cb_1(void (*callback)(void));   //
> > expected-error {{multiple 'callback' attributes specified}}
> > +__attribute__((callback(1))) __attribute__((callback(2))) void
> > multiple_cb_2(void (*callback1)(void), void (*callback2)(void)); //
> > expected-error {{multiple 'callback' attributes specified}}
> > +
> > +#ifdef HAS_THIS
> > +__attribute__((callback(0))) void oob_args_0(void (*callback)(void)); //
> > expected-error {{'callback' attribute specifies invalid callback callee}}
> > +#else
> > +__attribute__((callback(0))) void 

Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-22 Thread Doerfert, Johannes Rudolf via cfe-commits
On 01/22, Chandler Carruth wrote:
> On Sat, Jan 19, 2019 at 2:18 AM Johannes Doerfert via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
> 
> > Author: jdoerfert
> > Date: Fri Jan 18 21:36:54 2019
> > New Revision: 351629
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=351629=rev
> > Log:
> > Emit !callback metadata and introduce the callback attribute
> >
> >   With commit r351627, LLVM gained the ability to apply (existing) IPO
> >   optimizations on indirections through callbacks, or transitive calls.
> >   The general idea is that we use an abstraction to hide the middle man
> >   and represent the callback call in the context of the initial caller.
> >   It is described in more detail in the commit message of the LLVM patch
> >   r351627, the llvm::AbstractCallSite class description, and the
> >   language reference section on callback-metadata.
> >
> >   This commit enables clang to emit !callback metadata that is
> >   understood by LLVM. It does so in three different cases:
> > 1) For known broker functions declarations that are directly
> >generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
> > 2) For known broker functions that are identified by their name and
> >source location through the builtin detection, e.g.,
> >pthread_create from the POSIX thread API.
> > 3) For user annotated functions that carry the "callback(callee, ...)"
> >attribute. The attribute has to include the name, or index, of
> >the callback callee and how the passed arguments can be
> >identified (as many as the callback callee has). See the callback
> >attribute documentation for detailed information.
> >
> > Differential Revision: https://reviews.llvm.org/D55483
> >
> > ==
> > --- cfe/trunk/test/CodeGen/callback_pthread_create.c (added)
> > +++ cfe/trunk/test/CodeGen/callback_pthread_create.c Fri Jan 18 21:36:54
> > 2019
> > @@ -0,0 +1,32 @@
> > +// RUN: %clang -O1 %s -S -c -emit-llvm -o - | FileCheck %s
> > +// RUN: %clang -O1 %s -S -c -emit-llvm -o - | opt -ipconstprop -S |
> > FileCheck --check-prefix=IPCP %s
> > +
> > +// CHECK: declare !callback ![[cid:[0-9]+]] dso_local i32 @pthread_create
> > +// CHECK: ![[cid]] = !{![[cidb:[0-9]+]]}
> > +// CHECK: ![[cidb]] = !{i64 2, i64 3, i1 false}
> > +
> > +#include 
> 
> 
> Another thing I notecide is that this code assumes the system has
> `pthread.h` -- what about systems without it? I mean, you can disable the
> test, but it seems bad to lose test coverage just because of that.
 
So far, I disabled the test with a later addition which makes sure this
test is only run under Linux. I'm unsure why we loose coverage because
of that?

> I would much prefer that you provide your own stub `pthread.h` in the
> Inputs/... tree of the test suite and use that to test this in a portable
> way.

I do not completely follow but I'm open to improving the test. Basically
I have to make sure the builtin recognition will trigger on the header
file and the contained declaration. If we can somehow do this in a
portable way I'm all for it. Is that how we test other builtin gnu extensions?

Cheers,
  Johannes


> > +
> > +const int GlobalVar = 0;
> > +
> > +static void *callee0(void *payload) {
> > +// IPCP:  define internal i8* @callee0
> > +// IPCP-NEXT:   entry:
> > +// IPCP-NEXT: ret i8* null
> > +  return payload;
> > +}
> > +
> > +static void *callee1(void *payload) {
> > +// IPCP:  define internal i8* @callee1
> > +// IPCP-NEXT:   entry:
> > +// IPCP-NEXT: ret i8* bitcast (i32* @GlobalVar to i8*)
> > +  return payload;
> > +}
> > +
> > +void foo() {
> > +  pthread_t MyFirstThread;
> > +  pthread_create(, NULL, callee0, NULL);
> > +
> > +  pthread_t MySecondThread;
> > +  pthread_create(, NULL, callee1, (void *));
> > +}
> >
> > Added: cfe/trunk/test/CodeGenCXX/attr-callback.cpp
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr-callback.cpp?rev=351629=auto


signature.asc
Description: PGP signature
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-22 Thread Chandler Carruth via cfe-commits
On Sat, Jan 19, 2019 at 2:18 AM Johannes Doerfert via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: jdoerfert
> Date: Fri Jan 18 21:36:54 2019
> New Revision: 351629
>
> URL: http://llvm.org/viewvc/llvm-project?rev=351629=rev
> Log:
> Emit !callback metadata and introduce the callback attribute
>
>   With commit r351627, LLVM gained the ability to apply (existing) IPO
>   optimizations on indirections through callbacks, or transitive calls.
>   The general idea is that we use an abstraction to hide the middle man
>   and represent the callback call in the context of the initial caller.
>   It is described in more detail in the commit message of the LLVM patch
>   r351627, the llvm::AbstractCallSite class description, and the
>   language reference section on callback-metadata.
>
>   This commit enables clang to emit !callback metadata that is
>   understood by LLVM. It does so in three different cases:
> 1) For known broker functions declarations that are directly
>generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
> 2) For known broker functions that are identified by their name and
>source location through the builtin detection, e.g.,
>pthread_create from the POSIX thread API.
> 3) For user annotated functions that carry the "callback(callee, ...)"
>attribute. The attribute has to include the name, or index, of
>the callback callee and how the passed arguments can be
>identified (as many as the callback callee has). See the callback
>attribute documentation for detailed information.
>
> Differential Revision: https://reviews.llvm.org/D55483
>
> Added:
> cfe/trunk/test/CodeGen/attr-callback.c
> cfe/trunk/test/CodeGen/callback_annotated.c
> cfe/trunk/test/CodeGen/callback_openmp.c
> cfe/trunk/test/CodeGen/callback_pthread_create.c
> cfe/trunk/test/CodeGenCXX/attr-callback.cpp
> cfe/trunk/test/Sema/attr-callback-broken.c
> cfe/trunk/test/Sema/attr-callback.c
> cfe/trunk/test/SemaCXX/attr-callback-broken.cpp
> cfe/trunk/test/SemaCXX/attr-callback.cpp
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/include/clang/Basic/Attr.td
> cfe/trunk/include/clang/Basic/AttrDocs.td
> cfe/trunk/include/clang/Basic/Builtins.def
> cfe/trunk/include/clang/Basic/Builtins.h
> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/lib/Basic/Builtins.cpp
> cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Sema/SemaDecl.cpp
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> cfe/trunk/test/Analysis/retain-release.m
> cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test
> cfe/trunk/test/OpenMP/parallel_codegen.cpp
> cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
>
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=351629=351628=351629=diff
>
> ==
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Fri Jan 18 21:36:54 2019
> @@ -2003,6 +2003,9 @@ public:
>  /// No error
>  GE_None,
>
> +/// Missing a type
> +GE_Missing_type,
> +
>  /// Missing a type from 
>  GE_Missing_stdio,
>
>
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=351629=351628=351629=diff
>
> ==
> --- cfe/trunk/include/clang/Basic/Attr.td (original)
> +++ cfe/trunk/include/clang/Basic/Attr.td Fri Jan 18 21:36:54 2019
> @@ -190,6 +190,9 @@ class VariadicIdentifierArgument  // Like VariadicUnsignedArgument except values are ParamIdx.
>  class VariadicParamIdxArgument : Argument;
>
> +// A list of identifiers matching parameters or ParamIdx indices.
> +class VariadicParamOrParamIdxArgument : Argument;
> +
>  // Like VariadicParamIdxArgument but for a single function parameter
> index.
>  class ParamIdxArgument : Argument;
>
> @@ -1210,6 +1213,13 @@ def FormatArg : InheritableAttr {
>let Documentation = [Undocumented];
>  }
>
> +def Callback : InheritableAttr {
> +  let Spellings = [Clang<"callback">];
> +  let Args = [VariadicParamOrParamIdxArgument<"Encoding">];
> +  let Subjects = SubjectList<[Function]>;
> +  let Documentation = [CallbackDocs];
> +}
> +
>  def GNUInline : InheritableAttr {
>let Spellings = [GCC<"gnu_inline">];
>let Subjects = SubjectList<[Function]>;
>
> Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=351629=351628=351629=diff
>
> 

Re: r351629 - Emit !callback metadata and introduce the callback attribute

2019-01-22 Thread Chandler Carruth via cfe-commits
On Sat, Jan 19, 2019 at 2:18 AM Johannes Doerfert via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: jdoerfert
> Date: Fri Jan 18 21:36:54 2019
> New Revision: 351629
>
> URL: http://llvm.org/viewvc/llvm-project?rev=351629=rev
> Log:
> Emit !callback metadata and introduce the callback attribute
>
>   With commit r351627, LLVM gained the ability to apply (existing) IPO
>   optimizations on indirections through callbacks, or transitive calls.
>   The general idea is that we use an abstraction to hide the middle man
>   and represent the callback call in the context of the initial caller.
>   It is described in more detail in the commit message of the LLVM patch
>   r351627, the llvm::AbstractCallSite class description, and the
>   language reference section on callback-metadata.
>
>   This commit enables clang to emit !callback metadata that is
>   understood by LLVM. It does so in three different cases:
> 1) For known broker functions declarations that are directly
>generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
> 2) For known broker functions that are identified by their name and
>source location through the builtin detection, e.g.,
>pthread_create from the POSIX thread API.
> 3) For user annotated functions that carry the "callback(callee, ...)"
>attribute. The attribute has to include the name, or index, of
>the callback callee and how the passed arguments can be
>identified (as many as the callback callee has). See the callback
>attribute documentation for detailed information.
>
> Differential Revision: https://reviews.llvm.org/D55483
>
> Added:
> cfe/trunk/test/CodeGen/attr-callback.c
> cfe/trunk/test/CodeGen/callback_annotated.c
> cfe/trunk/test/CodeGen/callback_openmp.c
> cfe/trunk/test/CodeGen/callback_pthread_create.c
> cfe/trunk/test/CodeGenCXX/attr-callback.cpp
> cfe/trunk/test/Sema/attr-callback-broken.c
> cfe/trunk/test/Sema/attr-callback.c
> cfe/trunk/test/SemaCXX/attr-callback-broken.cpp
> cfe/trunk/test/SemaCXX/attr-callback.cpp
> Modified:
> cfe/trunk/include/clang/AST/ASTContext.h
> cfe/trunk/include/clang/Basic/Attr.td
> cfe/trunk/include/clang/Basic/AttrDocs.td
> cfe/trunk/include/clang/Basic/Builtins.def
> cfe/trunk/include/clang/Basic/Builtins.h
> cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> cfe/trunk/lib/AST/ASTContext.cpp
> cfe/trunk/lib/Basic/Builtins.cpp
> cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Sema/SemaDecl.cpp
> cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> cfe/trunk/test/Analysis/retain-release.m
> cfe/trunk/test/Misc/pragma-attribute-supported-attributes-list.test
> cfe/trunk/test/OpenMP/parallel_codegen.cpp
> cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
>
> Modified: cfe/trunk/include/clang/AST/ASTContext.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=351629=351628=351629=diff
>
> ==
> --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> +++ cfe/trunk/include/clang/AST/ASTContext.h Fri Jan 18 21:36:54 2019
> @@ -2003,6 +2003,9 @@ public:
>  /// No error
>  GE_None,
>
> +/// Missing a type
> +GE_Missing_type,
> +
>  /// Missing a type from 
>  GE_Missing_stdio,
>
>
> Modified: cfe/trunk/include/clang/Basic/Attr.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=351629=351628=351629=diff
>
> ==
> --- cfe/trunk/include/clang/Basic/Attr.td (original)
> +++ cfe/trunk/include/clang/Basic/Attr.td Fri Jan 18 21:36:54 2019
> @@ -190,6 +190,9 @@ class VariadicIdentifierArgument  // Like VariadicUnsignedArgument except values are ParamIdx.
>  class VariadicParamIdxArgument : Argument;
>
> +// A list of identifiers matching parameters or ParamIdx indices.
> +class VariadicParamOrParamIdxArgument : Argument;
> +
>  // Like VariadicParamIdxArgument but for a single function parameter
> index.
>  class ParamIdxArgument : Argument;
>
> @@ -1210,6 +1213,13 @@ def FormatArg : InheritableAttr {
>let Documentation = [Undocumented];
>  }
>
> +def Callback : InheritableAttr {
> +  let Spellings = [Clang<"callback">];
> +  let Args = [VariadicParamOrParamIdxArgument<"Encoding">];
> +  let Subjects = SubjectList<[Function]>;
> +  let Documentation = [CallbackDocs];
> +}
> +
>  def GNUInline : InheritableAttr {
>let Spellings = [GCC<"gnu_inline">];
>let Subjects = SubjectList<[Function]>;
>
> Modified: cfe/trunk/include/clang/Basic/AttrDocs.td
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=351629=351628=351629=diff
>
>