[flang-commits] [PATCH] D102768: [flang] simplify derived type info table format
Jean Perier via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu May 20 09:28:37 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG943839870a0b: [flang] simplify derived type info table format (authored by jeanPerier).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102768/new/
https://reviews.llvm.org/D102768
Files:
flang/include/flang/Semantics/tools.h
flang/include/flang/Semantics/type.h
flang/module/__fortran_type_info.f90
flang/test/Semantics/typeinfo01.f90
Index: flang/test/Semantics/typeinfo01.f90
===================================================================
--- flang/test/Semantics/typeinfo01.f90
+++ flang/test/Semantics/typeinfo01.f90
@@ -236,3 +236,14 @@
type(t(*)), intent(in) :: x
end subroutine
end module
+
+module m12
+ type :: t1
+ integer :: n
+ integer :: n2
+ integer :: n_3
+ ! CHECK: .n.n, SAVE, TARGET: ObjectEntity type: CHARACTER(1_8,1) init:"n"
+ ! CHECK: .n.n2, SAVE, TARGET: ObjectEntity type: CHARACTER(2_8,1) init:"n2"
+ ! CHECK: .n.n_3, SAVE, TARGET: ObjectEntity type: CHARACTER(3_8,1) init:"n_3"
+ end type
+end module
Index: flang/module/__fortran_type_info.f90
===================================================================
--- flang/module/__fortran_type_info.f90
+++ flang/module/__fortran_type_info.f90
@@ -88,7 +88,7 @@
type(DerivedType), pointer :: derived ! for category == Derived
type(Value), pointer :: lenValue(:) ! (SIZE(derived%lenParameterKind))
type(Value), pointer :: bounds(:, :) ! (2, rank): lower, upper
- class(*), pointer :: initialization
+ type(__builtin_c_ptr) :: initialization
end type
type :: ProcPtrComponent ! procedure pointer components
Index: flang/include/flang/Semantics/type.h
===================================================================
--- flang/include/flang/Semantics/type.h
+++ flang/include/flang/Semantics/type.h
@@ -154,6 +154,9 @@
: IntrinsicTypeSpec(TypeCategory::Character, std::move(kind)),
length_{std::move(length)} {}
const ParamValue &length() const { return length_; }
+ bool operator==(const CharacterTypeSpec &that) const {
+ return kind() == that.kind() && length_ == that.length_;
+ }
std::string AsFortran() const;
private:
Index: flang/include/flang/Semantics/tools.h
===================================================================
--- flang/include/flang/Semantics/tools.h
+++ flang/include/flang/Semantics/tools.h
@@ -459,7 +459,10 @@
name_iterator &nameIterator() { return nameIterator_; }
name_iterator nameEnd() { return nameEnd_; }
const Symbol &GetTypeSymbol() const { return derived_->typeSymbol(); }
- const Scope &GetScope() const { return DEREF(derived_->scope()); }
+ const Scope &GetScope() const {
+ return derived_->scope() ? *derived_->scope()
+ : DEREF(GetTypeSymbol().scope());
+ }
bool operator==(const ComponentPathNode &that) const {
return &*derived_ == &*that.derived_ &&
nameIterator_ == that.nameIterator_ &&
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102768.346764.patch
Type: text/x-patch
Size: 2580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210520/88f1840f/attachment-0001.bin>
More information about the flang-commits
mailing list