[PATCH] Only provide MS builtins when -fms-extensions is on

Richard Smith richard at metafoo.co.uk
Fri Nov 8 17:52:39 PST 2013


  What's the goal here?

  It seems strange to allow GNU builtins in MS mode but not MS builtins in GNU mode.


================
Comment at: include/clang/Basic/Builtins.def:674
@@ +673,3 @@
+// Microsoft builtins.  These are only active with -fms-extensions.
+// They are not library builtins despire our use of LIBBUILTIN.
+LIBBUILTIN(__assume,     "vb",  "n", 0, ALL_MS_LANGUAGES)
----------------
This isn't particularly great. Can you find a cleaner approach? Maybe:

  #ifndef RESTRICTED_BUILTIN
  #define RESTRICTED_BUILTIN(a, b, c, d) BUILTIN(a, b, c)
  #endif

... and then explicitly handle this in the one place where we care (in Builtins.cpp)? (Better macro name welcome!)


http://llvm-reviews.chandlerc.com/D2128



More information about the cfe-commits mailing list