21 Star 27 Fork 151

src-openEuler/gcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0228-Backport-SME-vec-Add-array_slice-constructors-from-n.patch 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
huangzifeng 提交于 2024-11-21 11:35 +08:00 . Sync patches from branch openEuler-24.09
From 044dc671f7eb723df5b6ce2364d6ae579c0cc984 Mon Sep 17 00:00:00 2001
From: Martin Jambor <mjambor@suse.cz>
Date: Tue, 30 Aug 2022 18:50:35 +0200
Subject: [PATCH 129/157] [Backport][SME] vec: Add array_slice constructors
from non-const and gc vectors
Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=15433c214df295f2281a90fcf283355b21beca0e
This patch adds constructors of array_slice that are required to
create them from non-const (heap or auto) vectors or from GC vectors.
gcc/ChangeLog:
2022-08-08 Martin Jambor <mjambor@suse.cz>
* vec.h (array_slice): Add constructors for non-const reference to
heap vector and pointers to heap vectors.
---
gcc/vec.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/gcc/vec.h b/gcc/vec.h
index 3ba7ea7ed..fc3b10c85 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -2264,6 +2264,18 @@ public:
array_slice (const vec<OtherT> &v)
: m_base (v.address ()), m_size (v.length ()) {}
+ template<typename OtherT>
+ array_slice (vec<OtherT> &v)
+ : m_base (v.address ()), m_size (v.length ()) {}
+
+ template<typename OtherT>
+ array_slice (const vec<OtherT, va_gc> *v)
+ : m_base (v ? v->address () : nullptr), m_size (v ? v->length () : 0) {}
+
+ template<typename OtherT>
+ array_slice (vec<OtherT, va_gc> *v)
+ : m_base (v ? v->address () : nullptr), m_size (v ? v->length () : 0) {}
+
iterator begin () { return m_base; }
iterator end () { return m_base + m_size; }
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc
master

搜索帮助