[PATCH] D86484: [flang] Don't attempt to compute element size if no DynamicType

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 18:24:00 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG044a71d828ca: [flang] Don't attempt to compute element size if no DynamicType (authored by tskeith).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86484/new/

https://reviews.llvm.org/D86484

Files:
  flang/lib/Semantics/compute-offsets.cpp


Index: flang/lib/Semantics/compute-offsets.cpp
===================================================================
--- flang/lib/Semantics/compute-offsets.cpp
+++ flang/lib/Semantics/compute-offsets.cpp
@@ -295,9 +295,8 @@
 }
 
 void ComputeOffsetsHelper::DoSymbol(Symbol &symbol) {
-  if (symbol.has<TypeParamDetails>() || symbol.has<SubprogramDetails>() ||
-      symbol.has<UseDetails>() || symbol.has<ProcBindingDetails>()) {
-    return; // these have type but no size
+  if (!symbol.has<ObjectEntityDetails>() && !symbol.has<ProcEntityDetails>()) {
+    return;
   }
   SizeAndAlignment s{GetSizeAndAlignment(symbol)};
   if (s.size == 0) {
@@ -324,7 +323,7 @@
 auto ComputeOffsetsHelper::GetElementSize(const Symbol &symbol)
     -> SizeAndAlignment {
   const DeclTypeSpec *type{symbol.GetType()};
-  if (!type) {
+  if (!evaluate::DynamicType::From(type).has_value()) {
     return {};
   }
   // TODO: The size of procedure pointers is not yet known


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86484.287543.patch
Type: text/x-patch
Size: 960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200825/2e2fb534/attachment.bin>


More information about the llvm-commits mailing list