[PATCH] Add support for assigning to . in AsmParser

Anders Waldenborg anders at 0x63.nu
Thu Jan 30 00:52:14 PST 2014



================
Comment at: lib/MC/MCParser/AsmParser.cpp:2128
@@ +2127,3 @@
+    if (Out.EmitValueToOffset(Value, 0)) {
+      Error(EqualLoc, "expected assembly-time absolute expression in assignment to pseudo-symbol '.'");
+      eatToEndOfStatement();
----------------
Saleem Abdulrasool wrote:
> Jim Grosbach wrote:
> > Other diagnostics for this sort of thing just say "expected absolute expression". Does the additional verbiage here communicate enough useful additional information to be worth diverging?
> IMO, the given message here is nicer than "expected absolute expression".
I only looked at the TokErrors and they seemed to be in the form "unexpected token in xyz". But here we always have a fully and properly parsed statement, so the extra clue given by "in ..." is probably not needed? I'll change it to be consistent with the other "expected absolute expression" for now.

If you think it would be useful to include the "in ..." for "expected absolute expression" I can do a separate patch to add that to all those error messages so it is consistent. But as these errors doesn't happen on syntax problems, I think that the location given already tells you enough about where there error happens. Possibly a message like "expression must have assembly-time constant value" would be clearer than "expected absolute expression". But again that would be a separate patch.


http://llvm-reviews.chandlerc.com/D2625



More information about the llvm-commits mailing list