[PATCH] D78403: Infer alignment of loads with unspecified alignment in IR/bitcode parsing.

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 03:12:45 PDT 2020


arichardson added a comment.

Thanks, this will be very useful for our out-of-tree CHERI changes. We have some tests where we would like to pass the datalayout on the command line using a lit substitution instead of hardcoding it in the test files. I can't remember exactly what problems were caused by setting the datalayout late, but I think it was related to errors due to function forward declarations being inserted in the wrong address space.

Just one general comment: I wonder if would make more sense to pass the `Module*` to the callback and let the tool perform any changes there? This would make it more flexible if we want to allow early overriding other aspects on the command line other than the datalayout.
Should also make the callbacks a bit shorter:
For example the llvm-as one could them be:

  auto SetDataLayout = [](llvm::Module*) {
    if (!ClDataLayout.empty())
      M->setDataLayout(ClDataLayout);
  };



================
Comment at: llvm/include/llvm/AsmParser/Parser.h:45
 ///              parsing.
 /// \param UpgradeDebugInfo Run UpgradeDebugInfo, which runs the Verifier.
 ///                         This option should only be set to false by llvm-as
----------------
This doc comment should be removed since the parameter is gone now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78403





More information about the llvm-commits mailing list