[PATCH] D55243: [mir] Serialize DILocation inline when not possible to use a metadata reference
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 3 18:17:18 PST 2018
dsanders marked 2 inline comments as done.
dsanders added inline comments.
================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:1706
+
+ if (expectAndConsume(MIToken::lparen))
+ return true;
----------------
aprantl wrote:
> I assume because of all the MIToken references there is no reasonable way that this code could be shared with LLParser?
I think a few small fragments are potentially sharable but the cost of doing so is going to outweigh the benefit. We'd have to find a way to keep the MIR lexer/parser in sync with LLParser's and be careful to avoid everything LLParser does with Instructions and other LLVM-IR level structures. It's probably best to keep the LLVM-IR and MIR parsers separate.
================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:1788
+
+ if (!HaveLine)
+ return error("DILocation requires line number");
----------------
Should the line field be required? It's optional in LLParser but the MIR printer always writes it (even for line 0)
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55243/new/
https://reviews.llvm.org/D55243
More information about the llvm-commits
mailing list