[cfe-dev] MSVC compiler intrinsics, need for direction.

Francois Pichet pichet2000 at gmail.com
Tue Oct 5 23:09:31 PDT 2010


sorry this was meant for clang-dev

Hi, I am preparing a patch to add MSVC builtins compiler intrinsics to
clang. (http://msdn.microsoft.com/en-us/library/26td21ds(v=VS.90).aspx)

Things like __noop, __debugbreak, __assume.

I see 2 possible implementations:
 1. Put the MSVC intrinsics directly into
clang\include\clang\Basic\Builtins.def and add an argument to specify
if they are MSVC, GCC, ALLNOMS or ALL etc..
This is similar to what we do for keyword tokens.
ex:
BUILTIN(__builtin___noop, "v", "", BUILTIN_MS)

2. Add a new file BuiltinsMSVC.def. Then make the appropriate changes
in the code to handle that: Merging BuiltinsMSVC.def. and
BuiltinsX86.def when triple: win32

I am not sure which is the best option but I am tempted to go with 1.
I would like to have the OK before I start coding that.

Thanks,




More information about the cfe-dev mailing list