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

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 14:21:09 PDT 2017


Prazek marked an inline comment as done.
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:
> Prazek wrote:
> > 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
> > +
> > Thanks for the testing command. Should I do anything in order to check if docs build?
> 
> On Windows, I use `make html` within the clang\docs directory to generate the actual sphinx docs -- that will tell you if there are sphinx issues. Be sure you do *not* commit the AttributeReference.rst file that it generates, however.
I tried building docs but it doesn't seem that there is any target like "html". Do you know if there is documentation on how to build docs? I couldn't find any.


https://reviews.llvm.org/D33852





More information about the cfe-commits mailing list