[all-commits] [llvm/llvm-project] 114e71: InstrEmitter.cpp - don't dereference a dyn_cast<>.

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jun 8 09:59:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 114e712c344fbf8361b97130e78baa2624ff9bca
      https://github.com/llvm/llvm-project/commit/114e712c344fbf8361b97130e78baa2624ff9bca
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-06-08 (Tue, 08 Jun 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

  Log Message:
  -----------
  InstrEmitter.cpp - don't dereference a dyn_cast<>.

dyn_cast<> can return nullptr which we would then dereference - use cast<> which will assert that the type is correct.


  Commit: 01b77159e30b38613ab700d8bb128b006822c58c
      https://github.com/llvm/llvm-project/commit/01b77159e30b38613ab700d8bb128b006822c58c
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-06-08 (Tue, 08 Jun 2021)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp

  Log Message:
  -----------
  PPCISelLowering.cpp - don't dereference a dyn_cast<>.

dyn_cast<> can return nullptr which we would then dereference - use cast<> which will assert that the type is correct.


  Commit: 52396577a2d85ef1b18f86e643fe3b1033750e15
      https://github.com/llvm/llvm-project/commit/52396577a2d85ef1b18f86e643fe3b1033750e15
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-06-08 (Tue, 08 Jun 2021)

  Changed paths:
    M llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

  Log Message:
  -----------
  Use llvm_unreachable for unsupported integer types.

As suggested on rG937c4cffd024, use llvm_unreachable for unhandled integer types (which shouldn't be possible) instead of breaking and dropping down to the existing fatal error handler.

Helps silence static analyzer warnings.


Compare: https://github.com/llvm/llvm-project/compare/ea10a86984ea...52396577a2d8


More information about the All-commits mailing list