[PATCH] D33852: Enable __declspec(selectany) on linux

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 31 22:13:46 PDT 2017


Prazek added inline comments.


================
Comment at: include/clang/Basic/AttrDocs.td:3154
+
+def SelectAnyDocs : Documentation {
+   let Content = [{This attribute makes global symbol have a weak definition
----------------
aaron.ballman wrote:
> I think you need to set the `Category` as well.
> 
> To test this you should run something like (replacing <root> and fixing up path separators as needed):
> ```
> clang-tblgen -gen-attr-docs -I <root>\llvm\tools\clang\include <root>\llvm\tools\clang\include\clang\Basic\Attr.td -o <root>\llvm\tools\clang\docs\AttributeReference.rst
> ```
Thanks for the testing command. Should I do anything in order to check if docs build?
I enabled docs with -DLLVM_BUILD_DOCS=ON, and I have sphinx. Everything builds, but I don't see docs anywhere.

the docs looks like this:
+selectany (gnu::selectany)
+--------------------------
+.. csv-table:: Supported Syntaxes
+   :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma", "Pragma clang attribute"
+
+   "X","X","X","", "", ""
+
+This attribute appertains to a global symbol, causing it to have a weak
+definition (
+.. _`linkonce`: https://llvm.org/docs/LangRef.html#linkage-types
+), allowing the linker to select any definition.
+
+For more information see
+.. `gcc documentation`: https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Microsoft-Windows-Variable-Attributes.html
+


https://reviews.llvm.org/D33852





More information about the cfe-commits mailing list