Page MenuHomePhabricator

[Assembler] Improve error when unable to evaluate expression.
ClosedPublic

Authored by sanwou01 on Jan 18 2017, 8:14 AM.

Details

Summary

Add an SMLoc to MCExpr. Most code does not generate or consume the
SMLoc (yet). Use CHECK-DAG where necessary.

Diff Detail

Repository
rL LLVM

Event Timeline

sanwou01 created this revision.Jan 18 2017, 8:14 AM
sanwou01 set the repository for this revision to rL LLVM.
sanwou01 added a subscriber: llvm-commits.

FYI, I do not have commit access.

rengolin edited edge metadata.

The change looks good, but it's a bit central to the MC layer, so I'll let Jim approve or add more people if necessary.

test/MC/AArch64/error-location-post-layout.s
4 ↗(On Diff #84838)

Why CHECK-DAG? Can they really come in different order?

grosbach edited edge metadata.Jan 18 2017, 10:19 AM

This LGTM in general. I agree w/ Renato that CHECK-DAG is a bit unexpected. Can you elaborate on why that's better than plain CHECK?

I've long wanted better plumbing of location info through the asm stuff. This is a nice step in that direction. Thank you for working on it! Do you intend to continue on with threading this through the various places that create MCExprs in the AsmParser?

sanwou01 updated this revision to Diff 84955.Jan 19 2017, 4:15 AM
sanwou01 edited the summary of this revision. (Show Details)

Removed uses of CHECK-DAG where they were unnecessary. Still required for the last two tests in ARM/error-location-post-layout.s because these /do/ come out in the "wrong" order.

@grosbach, I will be working on improving diagnostics throughout the assembler. So yes, I will be threading this through to the AsmParser whenever I come across an MCExpr with a default SMLoc. Seems reasonable to do this incrementally.

grosbach accepted this revision.Jan 19 2017, 11:20 AM

Great! Incremental is definitely the way to go for this sort of thing. Thanks again.

This revision is now accepted and ready to land.Jan 19 2017, 11:20 AM
This revision was automatically updated to reflect the committed changes.