This patch should close PR22004.
Diff Detail
Event Timeline
@probinson Any comments?
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
1321 | Update the comment |
I simply commented the check becuase it hides the case of identificator. There are no regression failed tests that's why I hope it's acceptable.
mcrosier, it seems you are "blame" in this code. Could you review it?
I'm happy to help, but it's been many years since I looked at this code. Can you be more verbose in your description of the problem as well as describe how this patch addresses the issue?
The initial problem was described in PR22004. The problem raises because this check does not allow using of identifiers starting from dot. But such IDs are legal for asm, e.g as local labels. As result we have (in this exactly case) the binary expression without RHS operand. It means "too few operands" like assertion says. If I comment out the check then everything works without any problems including all regression tests. Could I remove the check from the code?
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
1325 | Can you think of an example where Tok starts with '.' and is *not* an identifier? In other words, I'm thinking your change is causing this condition to be unconditionally false. If that's the case, then the right solution might be to remove this check entirely. Unfortunately, we don't have a lot of lit tests that cover the dot operator. Have you tested this chance on something more substantial than the llvm test suite? |
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
1325 | No, I tested it as "check-all" only. Could you suggest something suitable? |
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
1325 | Make sure check-clang passes, it has the interesting checks. If you already have clang checked out and configured, that would've been included in check-all. These test cases have this corner case: ../clang/test/CodeGen/ms-inline-asm-64.c: mov eax, [ebx].foo.a ../clang/test/CodeGen/ms-inline-asm-64.c: mov [ebx].foo.b, ecx |
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
1325 | Yes, I always have configured clang in my repository and I always use "check-all" which includes "check-clang". It passes. And your test is included and passes. |
I restored the condition like here:
if (PrevTK != AsmToken::Error && Tok.getString().startswith(".") && TK != AsmToken::Identifier)
I merged with trunk (both LLVM and Clang) and launched "check-all": there are no failed tests.
Reid, Chad - could you give me LGTM?
Did this actually need moving?