CodeGen: implement __emit intrinsic
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 17 Dec 2014 17:52:30 +0000 (17:52 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 17 Dec 2014 17:52:30 +0000 (17:52 +0000)
commit86b881c63e489256e779ad7d72aa8aac17fa3d06
treee940cba666eeb5c7303f949f30492b9c971bb42a
parent44ee1c0e91baeae6ea240c3224698b59174b3aee
CodeGen: implement __emit intrinsic

For MSVC compatibility, add the `__emit' builtin. This is used in the Windows
SDK headers, and must therefore be implemented as a builtin rather than an
intrinsic.

The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction
into the stream. The value must be a compile time constant expression. No
guarantees are made about the CPU and memory states after the execution of the
instruction.

Due to the unchecked nature of the builtin, only support this on Windows on ARM.

llvm-svn: 224438
clang/include/clang/Basic/BuiltinsARM.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/builtins-arm-msvc-compat-error.c [new file with mode: 0644]
clang/test/CodeGen/builtins-arm-msvc-compat-only.c [new file with mode: 0644]