[all-commits] [llvm/llvm-project] a76209: [ORC] Fix handling of casts in llvm.global_ctors.

lhames via All-commits all-commits at lists.llvm.org
Thu Apr 7 17:06:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a76209c265bdaca09d46ca4744c2d6e3602c908a
      https://github.com/llvm/llvm-project/commit/a76209c265bdaca09d46ca4744c2d6e3602c908a
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-04-07 (Thu, 07 Apr 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
    A llvm/test/ExecutionEngine/Orc/global-ctor-with-cast.ll

  Log Message:
  -----------
  [ORC] Fix handling of casts in llvm.global_ctors.

Removes a bogus dyn_cast_or_null that was breaking cast-expression handling when
parsing llvm.global_ctors.

The intent of this code was to identify Functions nested within cast
expressions, but the offending dyn_cast_or_null was actually blocking that:
Since a function is not a cast expression, we would set FuncC to null and break
the loop without finding the Function. The cast was not necessary either:
Functions are already Constants, and we didn't need to do anything
ConstantExpr-specific with FuncC, so we could just drop the cast.

Thanks to Jonas Hahnfeld for tracking this down.

http://llvm.org/PR54797




More information about the All-commits mailing list