diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2014-12-12 23:41:25 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-12-12 23:41:25 +0000 |
commit | b58ba0b375643a8bd9208c5d82606102db8db9e0 (patch) | |
tree | d44dc239dbb0e7016873a68a3c99c2cdb8d23ee5 /include/clang/CodeGen/CGFunctionInfo.h | |
parent | 4a3e3b733fb33d1884738cb496b112cb54286022 (diff) |
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
Diffstat (limited to 'include/clang/CodeGen/CGFunctionInfo.h')
-rw-r--r-- | include/clang/CodeGen/CGFunctionInfo.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 8aea6c3708..102d25d79e 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -352,6 +352,9 @@ class CGFunctionInfo : public llvm::FoldingSetNode { /// Whether this is an instance method. unsigned InstanceMethod : 1; + /// Whether this is a chain call. + unsigned ChainCall : 1; + /// Whether this function is noreturn. unsigned NoReturn : 1; @@ -360,7 +363,7 @@ class CGFunctionInfo : public llvm::FoldingSetNode { /// How many arguments to pass inreg. unsigned HasRegParm : 1; - unsigned RegParm : 4; + unsigned RegParm : 3; RequiredArgs Required; @@ -380,7 +383,8 @@ class CGFunctionInfo : public llvm::FoldingSetNode { public: static CGFunctionInfo *create(unsigned llvmCC, - bool InstanceMethod, + bool instanceMethod, + bool chainCall, const FunctionType::ExtInfo &extInfo, CanQualType resultType, ArrayRef<CanQualType> argTypes, @@ -412,6 +416,8 @@ public: bool isInstanceMethod() const { return InstanceMethod; } + bool isChainCall() const { return ChainCall; } + bool isNoReturn() const { return NoReturn; } /// In ARC, whether this function retains its return value. This @@ -462,6 +468,7 @@ public: void Profile(llvm::FoldingSetNodeID &ID) { ID.AddInteger(getASTCallingConvention()); ID.AddBoolean(InstanceMethod); + ID.AddBoolean(ChainCall); ID.AddBoolean(NoReturn); ID.AddBoolean(ReturnsRetained); ID.AddBoolean(HasRegParm); @@ -473,12 +480,14 @@ public: } static void Profile(llvm::FoldingSetNodeID &ID, bool InstanceMethod, + bool ChainCall, const FunctionType::ExtInfo &info, RequiredArgs required, CanQualType resultType, ArrayRef<CanQualType> argTypes) { ID.AddInteger(info.getCC()); ID.AddBoolean(InstanceMethod); + ID.AddBoolean(ChainCall); ID.AddBoolean(info.getNoReturn()); ID.AddBoolean(info.getProducesResult()); ID.AddBoolean(info.getHasRegParm()); |