From 324f918438715b4a0d024af5930628c1674f4fcd Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 19 Jan 2019 08:50:56 +0000 Subject: Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 58d1f0d71c..d311bb3c99 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -1,9 +1,8 @@ //==-- CGFunctionInfo.h - Representation of function argument/return types -==// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // -- cgit v1.2.3 From 2982a888ff92fd8c21872a3cfa27db21edb06e39 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Sat, 2 Feb 2019 01:48:23 +0000 Subject: Remove redundant FunctionDecl argument from a couple functions. This argument was added in r254554 in order to support the pass_object_size attribute. However, in r296076, the attribute's presence is now also represented in FunctionProtoType's ExtParameterInfo, and thus it's unnecessary to pass along a separate FunctionDecl. The functions modified are: RequiredArgs::forPrototype{,Plus}, and CodeGenTypes::ConvertFunctionType. After this, it's also (again) unnecessary to have a separate ConvertFunctionType function ConvertType, so convert callers back to the latter, leaving the former as an internal helper function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352946 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index d311bb3c99..52157f0c3c 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -440,31 +440,30 @@ public: /// /// If FD is not null, this will consider pass_object_size params in FD. static RequiredArgs forPrototypePlus(const FunctionProtoType *prototype, - unsigned additional, - const FunctionDecl *FD) { + unsigned additional) { if (!prototype->isVariadic()) return All; - if (FD) - additional += - llvm::count_if(FD->parameters(), [](const ParmVarDecl *PVD) { - return PVD->hasAttr(); + + if (prototype->hasExtParameterInfos()) + additional += llvm::count_if( + prototype->getExtParameterInfos(), + [](const FunctionProtoType::ExtParameterInfo &ExtInfo) { + return ExtInfo.hasPassObjectSize(); }); + return RequiredArgs(prototype->getNumParams() + additional); } - static RequiredArgs forPrototype(const FunctionProtoType *prototype, - const FunctionDecl *FD) { - return forPrototypePlus(prototype, 0, FD); + static RequiredArgs forPrototypePlus(CanQual prototype, + unsigned additional) { + return forPrototypePlus(prototype.getTypePtr(), additional); } - static RequiredArgs forPrototype(CanQual prototype, - const FunctionDecl *FD) { - return forPrototype(prototype.getTypePtr(), FD); + static RequiredArgs forPrototype(const FunctionProtoType *prototype) { + return forPrototypePlus(prototype, 0); } - static RequiredArgs forPrototypePlus(CanQual prototype, - unsigned additional, - const FunctionDecl *FD) { - return forPrototypePlus(prototype.getTypePtr(), additional, FD); + static RequiredArgs forPrototype(CanQual prototype) { + return forPrototypePlus(prototype.getTypePtr(), 0); } bool allowsOptionalArgs() const { return NumRequired != ~0U; } -- cgit v1.2.3 From 4b8a291bb6a526332b0f35ec8aed9ea9e97a9d31 Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Thu, 21 Feb 2019 04:55:50 +0000 Subject: [NFC] Always initialize all members in ABIArgInfo Differential Revision: https://reviews.llvm.org/D57523 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354546 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 52157f0c3c..862928bf4b 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -111,14 +111,15 @@ private: } ABIArgInfo(Kind K) - : TheKind(K), PaddingInReg(false), InReg(false), SuppressSRet(false) { - } - -public: - ABIArgInfo() - : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), - TheKind(Direct), PaddingInReg(false), InReg(false), - SuppressSRet(false) {} + : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), TheKind(K), + PaddingInReg(false), InAllocaSRet(false), IndirectByVal(false), + IndirectRealign(false), SRetAfterThis(false), InReg(false), + CanBeFlattened(false), SignExt(false), SuppressSRet(false) {} +} + +public : ABIArgInfo() + : ABIArgInfo(Direct) { +} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, llvm::Type *Padding = nullptr, -- cgit v1.2.3 From 21ccdf8d1ad9a71bea51855de379f9b74e7cfc1d Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Thu, 21 Feb 2019 06:12:41 +0000 Subject: Fix typo in r354546 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354548 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 862928bf4b..0076068e47 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -115,11 +115,9 @@ private: PaddingInReg(false), InAllocaSRet(false), IndirectByVal(false), IndirectRealign(false), SRetAfterThis(false), InReg(false), CanBeFlattened(false), SignExt(false), SuppressSRet(false) {} -} public : ABIArgInfo() - : ABIArgInfo(Direct) { -} + : ABIArgInfo(Direct) {} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, llvm::Type *Padding = nullptr, -- cgit v1.2.3 From 0eb31d1e1bbfa6d2c429913864af3740dceeca15 Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Thu, 21 Feb 2019 06:59:21 +0000 Subject: Revert r354546 This triggers an ICE on gcc 7, see http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17598/steps/build%20stage%201/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354549 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 0076068e47..52157f0c3c 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -111,13 +111,14 @@ private: } ABIArgInfo(Kind K) - : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), TheKind(K), - PaddingInReg(false), InAllocaSRet(false), IndirectByVal(false), - IndirectRealign(false), SRetAfterThis(false), InReg(false), - CanBeFlattened(false), SignExt(false), SuppressSRet(false) {} + : TheKind(K), PaddingInReg(false), InReg(false), SuppressSRet(false) { + } -public : ABIArgInfo() - : ABIArgInfo(Direct) {} +public: + ABIArgInfo() + : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), + TheKind(Direct), PaddingInReg(false), InReg(false), + SuppressSRet(false) {} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, llvm::Type *Padding = nullptr, -- cgit v1.2.3 From 39af588aaa995c092806bbb467680649b858d82b Mon Sep 17 00:00:00 2001 From: Mandeep Singh Grang Date: Fri, 3 May 2019 21:12:24 +0000 Subject: [COFF, ARM64] Fix ABI implementation of struct returns Summary: Related llvm patch: D60348. Patch co-authored by Sanjin Sijaric. Reviewers: rnk, efriedma, TomTan, ssijaric, ostannard Reviewed By: efriedma Subscribers: dmajor, richard.townsend.arm, ostannard, javed.absar, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60349 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359932 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CGFunctionInfo.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'include/clang/CodeGen/CGFunctionInfo.h') diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index 52157f0c3c..1f81072e23 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -95,7 +95,6 @@ private: bool InReg : 1; // isDirect() || isExtend() || isIndirect() bool CanBeFlattened: 1; // isDirect() bool SignExt : 1; // isExtend() - bool SuppressSRet : 1; // isIndirect() bool canHavePaddingType() const { return isDirect() || isExtend() || isIndirect() || isExpand(); @@ -111,14 +110,13 @@ private: } ABIArgInfo(Kind K) - : TheKind(K), PaddingInReg(false), InReg(false), SuppressSRet(false) { + : TheKind(K), PaddingInReg(false), InReg(false) { } public: ABIArgInfo() : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), - TheKind(Direct), PaddingInReg(false), InReg(false), - SuppressSRet(false) {} + TheKind(Direct), PaddingInReg(false), InReg(false) {} static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, llvm::Type *Padding = nullptr, @@ -407,16 +405,6 @@ public: CanBeFlattened = Flatten; } - bool getSuppressSRet() const { - assert(isIndirect() && "Invalid kind!"); - return SuppressSRet; - } - - void setSuppressSRet(bool Suppress) { - assert(isIndirect() && "Invalid kind!"); - SuppressSRet = Suppress; - } - void dump() const; }; -- cgit v1.2.3