[PATCH] D25995: Add documentation for transparent_union attribute

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 07:01:05 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL285292: Add documentation for the transparent_union attribute (authored by arphaman).

Changed prior to commit:
  https://reviews.llvm.org/D25995?vs=75905&id=76020#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25995

Files:
  cfe/trunk/include/clang/Basic/Attr.td
  cfe/trunk/include/clang/Basic/AttrDocs.td


Index: cfe/trunk/include/clang/Basic/AttrDocs.td
===================================================================
--- cfe/trunk/include/clang/Basic/AttrDocs.td
+++ cfe/trunk/include/clang/Basic/AttrDocs.td
@@ -2649,3 +2649,21 @@
 If a function has neither of these attributes, they become subject to the XRay heuristics used to determine whether a function should be instrumented or otherwise.
   }];
 }
+
+def TransparentUnionDocs : Documentation {
+  let Category = DocCatType;
+  let Content = [{
+This attribute can be applied to a union to change the behaviour of calls to
+functions that have an argument with a transparent union type. The compiler
+behaviour is changed in the following manner:
+
+- A value whose type is any member of the transparent union can be passed as an
+argument without the need to cast that value.
+
+- The argument is passed to the function using the calling convention of the
+first member of the transparent union. Consequently, all the members of the
+transparent union should have the same calling convention as its first member.
+
+Transparent unions are not supported in C++.
+  }];
+}
Index: cfe/trunk/include/clang/Basic/Attr.td
===================================================================
--- cfe/trunk/include/clang/Basic/Attr.td
+++ cfe/trunk/include/clang/Basic/Attr.td
@@ -1542,7 +1542,7 @@
 def TransparentUnion : InheritableAttr {
   let Spellings = [GCC<"transparent_union">];
 //  let Subjects = SubjectList<[Record, TypedefName]>;
-  let Documentation = [Undocumented];
+  let Documentation = [TransparentUnionDocs];
   let LangOpts = [COnly];
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25995.76020.patch
Type: text/x-patch
Size: 1612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161027/b4b3cdb3/attachment.bin>


More information about the cfe-commits mailing list