[PATCH] D41832: LLParser: do not verify LLVM module

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 09:37:36 PST 2018


aprantl added a comment.

> If target is not specified on llc command line, llc needs to parse the LLVM assembly to get the target. To parse the LLVM assembly, llc needs to pass the datalayout to LLParser first. However, it does not know the datalayout since it does not know the target.
>  It seems we have to go back the current approach, that is, let LLParser only checks debug info and ignores non-debug info. For those llvm tools which does not explicitly verify module after parsing, I can add explicit verification after parsing.

What about the other option: Don't run the verifier in LLParser and instead ensure that every client of LLParser runs the verifier?
We could even have the LLParser return a wrapper akin to

  class UnverifiedModule {
    Module *M;
  public:
    Module *verify();
  }

to force clients to verify.


https://reviews.llvm.org/D41832





More information about the llvm-commits mailing list