[llvm] 7cfc1af - [RISCV] Fix -Wdeprecated-declarations in RISCVInstrInfo.cpp (NFC)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 15:16:44 PDT 2023


On Mon, Apr 24, 2023 at 9:01 PM Jie Fu via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Jie Fu
> Date: 2023-04-25T11:54:16+08:00
> New Revision: 7cfc1af1556943773c02f765bff374304609fd07
>
> URL:
> https://github.com/llvm/llvm-project/commit/7cfc1af1556943773c02f765bff374304609fd07
> DIFF:
> https://github.com/llvm/llvm-project/commit/7cfc1af1556943773c02f765bff374304609fd07.diff
>
> LOG: [RISCV] Fix -Wdeprecated-declarations in RISCVInstrInfo.cpp (NFC)
>
> /Users/jiefu/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:2636:10:
> error: 'makeArrayRef<std::pair<llvm::MachineMemOperand::Flags, const char
> *>, 2UL>' is deprecated: Use deduction guide instead
> [-Werror,-Wdeprecated-declarations]
>   return makeArrayRef(TargetFlags);
>          ^~~~~~~~~~~~
>          ArrayRef
> /Users/jiefu/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:572:3: note:
> 'makeArrayRef<std::pair<llvm::MachineMemOperand::Flags, const char *>,
> 2UL>' has been explicitly marked deprecated here
>   LLVM_DEPRECATED("Use deduction guide instead", "ArrayRef")
>   ^
> /Users/jiefu/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50:
> note: expanded from macro 'LLVM_DEPRECATED'
>                                                  ^
> 1 error generated.
>
> Added:
>
>
> Modified:
>     llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
> b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
> index 4a8c5966d4b0..f3c7385965c8 100644
> --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
> +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
> @@ -2633,7 +2633,7 @@
> RISCVInstrInfo::getSerializableMachineMemOperandTargetFlags() const {
>    static const std::pair<MachineMemOperand::Flags, const char *>
> TargetFlags[] =
>        {{MONontemporalBit0, "riscv-nontemporal-domain-bit-0"},
>         {MONontemporalBit1, "riscv-nontemporal-domain-bit-1"}};
> -  return makeArrayRef(TargetFlags);
> +  return ArrayRef<std::pair<MachineMemOperand::Flags, const char
> *>>(TargetFlags);
>

I believe, if you want, you can omit the template parameters and write this
as:
return ArrayRef(TargetFlags);

?


>  }
>
>  // Returns true if this is the sext.w pattern, addiw rd, rs1, 0.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230501/8fd4121b/attachment.html>


More information about the llvm-commits mailing list