projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1706f2
)
[flang] add attribute to trim runtime implementation establish call
author
Jean Perier
<jperier@nvidia.com>
Wed, 24 Feb 2021 17:53:03 +0000
(18:53 +0100)
committer
Jean Perier
<jperier@nvidia.com>
Wed, 24 Feb 2021 17:53:55 +0000
(18:53 +0100)
CFI allocatable attribute is needed so that the descriptor for the
result can be allocated/deallocated.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D97395
flang/runtime/character.cpp
patch
|
blob
|
history
diff --git
a/flang/runtime/character.cpp
b/flang/runtime/character.cpp
index
c241afd
..
9476bde
100644
(file)
--- a/
flang/runtime/character.cpp
+++ b/
flang/runtime/character.cpp
@@
-686,7
+686,8
@@
void RTNAME(Trim)(Descriptor &result, const Descriptor &string,
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);
}