[PATCH] D97395: [flang] add attribute to trim runtime implementation establish call

Jean Perier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 08:47:53 PST 2021


jeanPerier created this revision.
jeanPerier added a reviewer: klausler.
jeanPerier added a project: Flang.
Herald added a subscriber: jdoerfert.
jeanPerier requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

CFI allocatable attribute is needed so that the descriptor for the
result can be allcoated/deallocated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97395

Files:
  flang/runtime/character.cpp


Index: flang/runtime/character.cpp
===================================================================
--- flang/runtime/character.cpp
+++ flang/runtime/character.cpp
@@ -686,7 +686,8 @@
     terminator.Crash(
         "TRIM: bad string type code %d", static_cast<int>(string.raw().type));
   }
-  result.Establish(string.type(), resultBytes, nullptr, 0);
+  result.Establish(string.type(), resultBytes, nullptr, 0, nullptr,
+      CFI_attribute_allocatable);
   RUNTIME_CHECK(terminator, result.Allocate(nullptr, nullptr) == CFI_SUCCESS);
   std::memcpy(result.OffsetElement(), string.OffsetElement(), resultBytes);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97395.326110.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210224/8e7c8b2e/attachment-0001.bin>


More information about the llvm-commits mailing list