[PATCH] ARM IAS: support .movsp

Renato Golin renato.golin at linaro.org
Tue Jan 21 02:29:56 PST 2014



================
Comment at: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:169
@@ +168,3 @@
+  assert((Reg != ARM::SP && Reg != ARM::PC) &&
+         "the operand of .movsp cannot be either sp or pc");
+  assert(UsedFP && ".setfp must precede .movsp");
----------------
Saleem Abdulrasool wrote:
> Logan Chien wrote:
> > It seems that you have added these assertions to address Renato's comments.  However, I feel this is not necessary.  IMO, the assembler which will assemble the generated assembly will perform such check.  How do you think, Renato?
> Yes, the assembler will perform this check.  This is simply asserting that we do not end up here in that case.
Asserts are more for safety and documentation than correctness, and it'll catch bugs we can't see right now in this implementation in the future, and will give a decent error message to the developer (not users).

IMO, asserts are rarely redundant.


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



More information about the llvm-commits mailing list