]> granicus.if.org Git - clang/commit
Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)
authorHans Wennborg <hans@hanshq.net>
Wed, 6 Mar 2019 10:26:19 +0000 (10:26 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 6 Mar 2019 10:26:19 +0000 (10:26 +0000)
commitd47768c5aa75c418c8e6ba96b1c05f8582b30702
tree971120bcaeba1db2bfeba132fb1c3be81f97c4fc
parent45032a803d969a57c2161bfd14a75da71862b84b
Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)

Apparently GCC allows this, and there's code relying on it (see bug).

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()).

Differential Revision: https://reviews.llvm.org/D58821

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355491 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/APValue.h
lib/AST/APValue.cpp
lib/AST/ExprConstant.cpp
lib/CodeGen/CGStmt.cpp
lib/Sema/SemaStmtAsm.cpp
test/CodeGen/x86-64-inline-asm.c
test/Sema/inline-asm-validate-x86.c