aaron.ballman added a comment.

The patch is missing semantic test cases. I would like to see tests of the 
attribute being accepted, as well as rejected because the subject was 
incorrect, args were provided, etc.

Also, I believe there are attributes which this attribute should not be 
combined with, such as `__declspec(naked)`. I think we should diagnose in that 
case (MSVC does not because the entire object file is hotpatched, not 
individual functions). e.g., `__declspec(naked) void f(void) 
__attribute__((ms_hook_prologue));`


================
Comment at: include/clang/Basic/Attr.td:2032
@@ -2031,1 +2031,3 @@
 
+def MSHookPrologue : InheritableAttr {
+  let Spellings = [GCC<"ms_hook_prologue">];
----------------
I am wondering whether we want this to be a target-specific attribute or not. 
Right now, this attribute will be silently accepted for CPUs that MSVC does not 
support, for instance. If we made the attribute target-specific, then users 
would get appropriate diagnostics for those architectures.


http://reviews.llvm.org/D19909



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to