Implement the __builtin_call_with_static_chain GNU extension.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 12 Dec 2014 23:41:25 +0000 (23:41 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 12 Dec 2014 23:41:25 +0000 (23:41 +0000)
commitf770683f14f98eae7c64b942c1e6c3470ec0c81b
treec49c70db436ff0782689c19eae57f4ee135655cb
parent620fb2206d28e78aa2549f37264d49108166c83c
Implement the __builtin_call_with_static_chain GNU extension.

The extension has the following syntax:

  __builtin_call_with_static_chain(Call, Chain)
  where Call must be a function call expression and Chain must be of pointer type

This extension performs a function call Call with a static chain pointer
Chain passed to the callee in a designated register. This is useful for
calling foreign language functions whose ABI uses static chain pointers
(e.g. to implement closures).

Differential Revision: http://reviews.llvm.org/D6332

llvm-svn: 224167
16 files changed:
clang/include/clang/Basic/Builtins.def
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/CodeGen/CGFunctionInfo.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGCall.cpp
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGExprCXX.cpp
clang/lib/CodeGen/CGObjCMac.cpp
clang/lib/CodeGen/CodeGenABITypes.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/CodeGen/CodeGenTypes.h
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGenCXX/call-with-static-chain.cpp [new file with mode: 0644]
clang/test/Sema/call-with-static-chain.c [new file with mode: 0644]
clang/test/SemaCXX/call-with-static-chain.cpp [new file with mode: 0644]