[llvm] Add the 'initializes' attribute langref and support (PR #84803)

Haopeng Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 21:25:26 PDT 2024


================
@@ -616,6 +661,23 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
     return Result;
   }
 
+  if (hasAttribute(Attribute::Initializes)) {
+    std::string Result;
+    raw_string_ostream OS(Result);
+    ConstantRangeList CRL = getValueAsConstantRangeList();
+    OS << "initializes(";
+    size_t i = 0;
+    for (auto &CR : CRL) {
----------------
haopliu wrote:

Nice util! Applied `interleave` instead of `interleaveComma` to avoid the space after comma.

https://github.com/llvm/llvm-project/pull/84803


More information about the llvm-commits mailing list