]> granicus.if.org Git - clang/commit
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)
commitb58ba0b375643a8bd9208c5d82606102db8db9e0
treed44dc239dbb0e7016873a68a3c99c2cdb8d23ee5
parent4a3e3b733fb33d1884738cb496b112cb54286022
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224167 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/Basic/Builtins.def
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/CodeGen/CGFunctionInfo.h
lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprCXX.cpp
lib/CodeGen/CGObjCMac.cpp
lib/CodeGen/CodeGenABITypes.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/CodeGenTypes.h
lib/CodeGen/TargetInfo.cpp
lib/Sema/SemaChecking.cpp
test/CodeGenCXX/call-with-static-chain.cpp [new file with mode: 0644]
test/Sema/call-with-static-chain.c [new file with mode: 0644]
test/SemaCXX/call-with-static-chain.cpp [new file with mode: 0644]