[all-commits] [llvm/llvm-project] 65c6ae: [Utils] isLegalToPromote - Fix missing null check ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Sep 15 06:53:11 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 65c6ae3b6aceb934a76c5b10b244edeed80e9cac
      https://github.com/llvm/llvm-project/commit/65c6ae3b6aceb934a76c5b10b244edeed80e9cac
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-15 (Tue, 15 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp

  Log Message:
  -----------
  [Utils] isLegalToPromote - Fix missing null check before writing to FailureReason.

The FailureReason input parameter maybe null, we check this in all other cases in the method but this one was missed somehow.

Fixes clang-tidy warning.


  Commit: 97a23ab28ad91d589e6c0bb5dee6ae78c154da8a
      https://github.com/llvm/llvm-project/commit/97a23ab28ad91d589e6c0bb5dee6ae78c154da8a
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-15 (Tue, 15 Sep 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp

  Log Message:
  -----------
  AMDGPUPrintfRuntimeBinding.cpp - drop unnecessary casts/dyn_casts. NFCI.

GetElementPtrInst::Create returns a GetElementPtrInst* so we don't need to cast. Similarly IntegerType inherits from the Type base class.

Also, I've used auto* in a few places to cleanup the code.

Helps fix some clang-tidy warnings which saw the dyn_casts and warned that these can return null.


Compare: https://github.com/llvm/llvm-project/compare/2d8f0c05dbe7...97a23ab28ad9


More information about the All-commits mailing list