diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 17:50:49 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-05 17:52:57 +0200 |
commit | 5905cbdbcf6d760303ca87f27e04824f26976de4 (patch) | |
tree | 16ea452b43613d027a78c18b033f7659f0cdbbbf /gcc/d/dmd/cppmangle.c | |
parent | 300452d7bf1d3a0ff3f7585a1166f3d473c70556 (diff) | |
download | gcc-5905cbdbcf6d760303ca87f27e04824f26976de4.zip gcc-5905cbdbcf6d760303ca87f27e04824f26976de4.tar.gz gcc-5905cbdbcf6d760303ca87f27e04824f26976de4.tar.bz2 |
d: Merge upstream dmd 56f0a65c4.
Updates the Target interface, removing static from all members, so all
field accesses and member function calls go through a single global
'target'. Information relating to extern ABI are now in TargetC,
TargetCPP, and TargetObjC for each supported language respectively.
Reviewed-on: https://github.com/dlang/dmd/pull/11228
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 56f0a65c4.
* d-builtins.cc (build_frontend_type): Remove static.
(d_build_builtins_module): Use target.va_listType() to get front-end
type for va_list.
(d_init_builtins): Move creation of va_list to Target::va_listType.
* d-codegen.cc (build_interface_binfo): Use new target global.
(build_vindex_ref): Likewise.
(identity_compare_p): Likewise.
* d-ctfloat.cc (CTFloat::parse): Likewise.
* d-lang.cc (d_init): Likewise.
* d-port.cc (Port::isFloat32LiteralOutOfRange): Likewise.
(Port::isFloat64LiteralOutOfRange): Likewise.
* d-target.cc (define_float_constants): Initialize constants through a
reference, instead of setting globals.
(Target::_init): Initialize new fields instead of setting globals.
(Target::va_listType): Build front-end type from va_list_type_node.
(Target::toCppMangle): Renamed to ...
(TargetCPP::toMangle): ... this.
(Target::cppTypeInfoMangle): Renamed to ...
(TargetCPP::typeInfoMangle): ... this.
(Target::cppTypeMangle): Renamed to ...
(TargetCPP::typeMangle): this.
(Target::cppParameterType): Renamed to ...
(TargetCPP::parameterType): ... this. Use target.va_listType() to get
front-end type for va_list.
(Target::cppFundamentalType): Renamed to ...
(TargetCPP::fundamentalType): ... this.
* d-tree.h (build_frontend_type): Declare.
* decl.cc (base_vtable_offset): Use new target global.
* typeinfo.cc (layout_classinfo_interfaces): Likewise.
(layout_cpp_typeinfo): Likewise.
* types.cc (valist_array_p): Use target.va_listType() to get front-end
type for va_list.
(layout_aggregate_type): Use new target global.
Diffstat (limited to 'gcc/d/dmd/cppmangle.c')
-rw-r--r-- | gcc/d/dmd/cppmangle.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/d/dmd/cppmangle.c b/gcc/d/dmd/cppmangle.c index a508022..f39c248 100644 --- a/gcc/d/dmd/cppmangle.c +++ b/gcc/d/dmd/cppmangle.c @@ -131,7 +131,7 @@ class CppMangleVisitor : public Visitor { // First check the target whether some specific ABI is being followed. bool isFundamental; - if (Target::cppFundamentalType(t, isFundamental)) + if (target.cpp.fundamentalType(t, isFundamental)) return isFundamental; if (t->ty == Tenum) { @@ -672,7 +672,7 @@ class CppMangleVisitor : public Visitor { ParamsCppMangle *p = (ParamsCppMangle *)ctx; CppMangleVisitor *mangler = p->mangler; - Type *t = Target::cppParameterType(fparam); + Type *t = target.cpp.parameterType(fparam); if (t->ty == Tsarray) { // Static arrays in D are passed by value; no counterpart in C++ @@ -803,7 +803,7 @@ public: return error(t); // Handle any target-specific basic types. - if (const char *tm = Target::cppTypeMangle(t)) + if (const char *tm = target.cpp.typeMangle(t)) { // Only do substitutions for non-fundamental types. if (!isFundamentalType(t) || t->isConst()) @@ -862,10 +862,10 @@ public: case Tuns32: c = 'j'; break; case Tfloat32: c = 'f'; break; case Tint64: - c = (Target::c_longsize == 8 ? 'l' : 'x'); + c = (target.c.longsize == 8 ? 'l' : 'x'); break; case Tuns64: - c = (Target::c_longsize == 8 ? 'm' : 'y'); + c = (target.c.longsize == 8 ? 'm' : 'y'); break; case Tint128: c = 'n'; break; case Tuns128: c = 'o'; break; @@ -899,7 +899,7 @@ public: CV_qualifiers(t); // Handle any target-specific vector types. - if (const char *tm = Target::cppTypeMangle(t)) + if (const char *tm = target.cpp.typeMangle(t)) { buf->writestring(tm); } @@ -1030,7 +1030,7 @@ public: CV_qualifiers(t); // Handle any target-specific struct types. - if (const char *tm = Target::cppTypeMangle(t)) + if (const char *tm = target.cpp.typeMangle(t)) { buf->writestring(tm); } |