[PATCH] D36712: Emit section information for extern variables

Elizabeth Andrews via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 08:33:20 PDT 2017

eandrews added a comment.

In https://reviews.llvm.org/D36712#842477, @kparzysz wrote:

> In the cases when the section is explicitly given on a definition, it was likely imposed by something like the "section" attribute in the source. I don't think it's unreasonable to expect that the declarations (in the original source as well as in the generated IR) should carry that information as well. However, since clang has apparently been ignoring that attribute on declarations, it's been generating IR where declarations may not have sections, but the corresponding definitions do.

Does this result in unexpected behavior though? Won't this just result in the global being defined in the specified section?

I can mention this case explicitly in the documentation. However I am not sure whether it's UB or if the global will be defined in specified section.


More information about the cfe-commits mailing list