[PATCH] D58821: Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 05:27:35 PST 2019


hans created this revision.
hans added reviewers: efriedma, rnk, rsmith, void.
Herald added subscribers: jdoerfert, eraman.

Apparently GCC allows this, and there's code relying on it (see bug, which is a release blocker for llvm 8).

The idea is to allow expression that would have been allowed if they were cast to int. So I based the code on how such a cast would be done (the CK_PointerToIntegral case in IntExprEvaluator::VisitCastExpr()).

I'm unfamiliar with this code, especially the LValue variant of APValue, so please take a careful look.


https://reviews.llvm.org/D58821

Files:
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/Sema/SemaStmtAsm.cpp
  clang/test/CodeGen/x86-64-inline-asm.c
  clang/test/Sema/inline-asm-validate-x86.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58821.188887.patch
Type: text/x-patch
Size: 4844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190301/6c4a0b11/attachment-0001.bin>


More information about the cfe-commits mailing list