From: Matt Arsenault Date: Sun, 1 Jan 2023 19:12:55 +0000 (-0500) Subject: OpenMPOpt: Use getFnAttributeAsParsedInteger X-Git-Tag: upstream/17.0.6~22279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7425e299e9ff8cee9290cb6ffeb5fd056e77b87;p=platform%2Fupstream%2Fllvm.git OpenMPOpt: Use getFnAttributeAsParsedInteger --- diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp index f752ff8..84469ea 100644 --- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -4710,10 +4710,7 @@ private: // Iterate over the kernels that reach this function for (Kernel K : CallerKernelInfoAA.ReachingKernelEntries) { - int32_t NextAttrVal = -1; - if (K->hasFnAttribute(Attr)) - NextAttrVal = - std::stoi(K->getFnAttribute(Attr).getValueAsString().str()); + int32_t NextAttrVal = K->getFnAttributeAsParsedInteger(Attr, -1); if (NextAttrVal == -1 || (CurrentAttrValue != -1 && CurrentAttrValue != NextAttrVal))