[PATCH] D93946: [FuncAttrs] Infer noreturn

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 06:14:33 PST 2021


markus added a comment.

Not terribly important but isn't

> A function is noreturn if all blocks terminating with a ReturnInst contain a call to a noreturn function.

slightly in conflict with the Lint pass containing the following "Unusual" warning?

  void Lint::visitReturnInst(ReturnInst &I) {
    Function *F = I.getParent()->getParent();
    Assert(!F->doesNotReturn(),
           "Unusual: Return statement in function with noreturn attribute", &I);
  
    if (Value *V = I.getReturnValue()) {
      Value *Obj = findValue(V, /*OffsetOk=*/true);
      Assert(!isa<AllocaInst>(Obj), "Unusual: Returning alloca value", &I);
    }
  }

Well I guess "Unusual" is not really a warning but still it kind of indicates that something is off. So maybe that Lint printout should be removed or updated somehow?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93946/new/

https://reviews.llvm.org/D93946



More information about the llvm-commits mailing list