[llvm] 5cb4419 - [Target/PPC] Silence an unused variable warning. NFC.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 11:15:18 PDT 2020


Could you include a description of the change (rather than the
motivation for the change) in the commit message? Helps with
post-commit review of changes like this. (& somewhat more important
what was changed rather than the compiler warning that motivated the
change)

Also - if "CE" is only used in the assert, please roll it into the
assertion rather than using (void) casts (see the last part of this
section: https://llvm.org/docs/CodingStandards.html#assert-liberally
), ie:

assert(isInt<34>(cast<MCConstantExpr>(RHS)->getValue()) && "Value must
fit in 34 bits");

On Mon, Jun 15, 2020 at 11:05 AM Davide Italiano via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Davide Italiano
> Date: 2020-06-15T11:05:01-07:00
> New Revision: 5cb44196aa73579defb1ef7e1e9339909c097ef5
>
> URL: https://github.com/llvm/llvm-project/commit/5cb44196aa73579defb1ef7e1e9339909c097ef5
> DIFF: https://github.com/llvm/llvm-project/commit/5cb44196aa73579defb1ef7e1e9339909c097ef5.diff
>
> LOG: [Target/PPC] Silence an unused variable warning. NFC.
>
> Added:
>
>
> Modified:
>     llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
> index 5b9a05486144..cd6bce24be5f 100644
> --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
> +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
> @@ -243,6 +243,7 @@ PPCMCCodeEmitter::getMemRI34PCRelEncoding(const MCInst &MI, unsigned OpNo,
>      const MCSymbolRefExpr *SRE = cast<MCSymbolRefExpr>(LHS);
>      (void)SRE;
>      const MCConstantExpr *CE = cast<MCConstantExpr>(RHS);
> +    (void)CE;
>      assert(isInt<34>(CE->getValue()) && "Value must fit in 34 bits.");
>
>      // Currently these are the only valid PCRelative Relocations.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list