[clang] 43606ef - Suppress an "unused variable" warning in release build

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 21 20:32:29 PDT 2020


Does "isIntegerConstantExpr" have side effects that are desired/necessary?
Otherwise please change this to roll the isIntegerConstantExpr into the
assert (so that it is only executed when asserts are enabled)

On Tue, Mar 10, 2020 at 10:11 AM Mikhail Maltsev via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

>
> Author: Mikhail Maltsev
> Date: 2020-03-10T17:10:52Z
> New Revision: 43606efb6847fc9c79e7d93760a2a6191e8a8539
>
> URL:
> https://github.com/llvm/llvm-project/commit/43606efb6847fc9c79e7d93760a2a6191e8a8539
> DIFF:
> https://github.com/llvm/llvm-project/commit/43606efb6847fc9c79e7d93760a2a6191e8a8539.diff
>
> LOG: Suppress an "unused variable" warning in release build
>
> Added:
>
>
> Modified:
>     clang/lib/Sema/SemaChecking.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/clang/lib/Sema/SemaChecking.cpp
> b/clang/lib/Sema/SemaChecking.cpp
> index 24d0d9209a1d..8a2b4b019663 100644
> --- a/clang/lib/Sema/SemaChecking.cpp
> +++ b/clang/lib/Sema/SemaChecking.cpp
> @@ -2094,6 +2094,7 @@ bool Sema::CheckARMCoprocessorImmediate(const Expr
> *CoprocArg, bool WantCDE) {
>
>    llvm::APSInt CoprocNoAP;
>    bool IsICE = CoprocArg->isIntegerConstantExpr(CoprocNoAP, Context);
> +  (void)IsICE;
>    assert(IsICE && "Coprocossor immediate is not a constant expression");
>    int64_t CoprocNo = CoprocNoAP.getExtValue();
>    assert(CoprocNo >= 0 && "Coprocessor immediate must be non-negative");
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200321/65beec74/attachment-0001.html>


More information about the cfe-commits mailing list