[PATCH] D55616: Emit ASM input in a constant context

Bill Wendling via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 13 16:12:24 PST 2018


void added a comment.

In D55616#1329301 <https://reviews.llvm.org/D55616#1329301>, @jyknight wrote:

> This seems like a good start, but not complete.
>
> "n" and "i" both should require that their argument is a constant expression. For "n", it actually must be an immediate constant integer, so setRequiresImmediate() should be used there. For "i", you may use an lvalue constant as well. The way we seem to indicate that, today, is with `if (!Info.allowsRegister() && !Info.allowsMemory())`. However the code in that block does not today *require* that the evaluation as a constant succeed...and it should.
>
> It should also only require that the result is an integer when `requiresImmediateConstant()`.
>
> Additionally, the Sema code needs to have the same conditions as the CodeGen code for when a constant expression is required, but it doesn't. (before or after your change).


Have I mentioned how much I *love* inline asm? :-)

I think I've addressed all of your concerns. PTAL.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55616/new/

https://reviews.llvm.org/D55616





More information about the cfe-commits mailing list