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

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 09:40:59 PST 2018


yaxunl added a comment.

In https://reviews.llvm.org/D41832#989171, @aprantl wrote:

> > 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.


The parser needs to drop the invalid debug info. To do that it needs to call the verifier to check whether the debug info is valid. Do we also want to move dropping invalid debug info out of parser?


https://reviews.llvm.org/D41832





More information about the llvm-commits mailing list