<div dir="ltr">Committed in r226148.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 12:07 AM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/15/2015 03:31 AM, Richard Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
LGTM, thanks!<br>
</blockquote>
<br>
Can somebody please commit this, as I don't have commit access.  Thanks.<br>
<br>
[Is there some general expectation that people w/o commit rights mark their patch mails in a certain way that makes it obvious they ask for review + commit?]<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Tue, Jan 6, 2015 at 12:03 PM, Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a><br></span><span class="">
<mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>> wrote:<br>
<br>
    On 12/19/2014 05:13 AM, Richard Smith wrote:<br>
<br>
        On Tue, Dec 16, 2014 at 1:47 AM, Stephan Bergmann<br>
        <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>><br></span><span class="">
        <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a> <mailto:<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>>>> wrote:<br>
<br>
             Is there any update on this?<br>
<br>
<br>
        Please move the attribute to buildImplicitRecord; this attribute<br>
        should<br>
        be applied to all implicitly-declared record types. Also, please<br>
        reformat the patch to 80 columns and add a testcase.<br>
<br>
<br></span>
    Done, see attached va_list_tag_default___<u></u>visibility.patch.  (I added<div><div class="h5"><br>
    the test to test/CodeGenCXX/ so that it can #include <typeinfo>.)<br>
<br>
             On 07/09/2014 10:37 AM, Alp Toker wrote:<br>
<br>
                 On 09/07/2014 11:29, Alp Toker wrote:<br>
<br>
                     On 09/07/2014 09:55, Stephan Bergmann wrote:<br>
<br>
                         ping<br>
<br>
                         On 06/25/2014 05:45 PM, Stephan Bergmann wrote:<br>
<br>
                             I stumbled across this on Linux with<br>
                             -fvisibility=hidden when<br>
                             -fsanitize=function reported a false<br>
        positive for an<br>
                             indirect call to a<br>
                             function with a va_list (aka<br>
        __builtin_va_list, aka<br>
                             __va_list_tag<br>
                             (*)[1]) parameter.  Because __va_list_tag was<br>
                             considered hidden, the<br>
                             RTTI for the function's type was not<br>
        exported from<br>
                             the two shared<br>
                             libraries involved, so the equality check<br>
        failed.<br>
<br>
                             This would apparently also need to be fixed<br>
        in the other<br>
                             Create*BuiltinVaListDecl variants, but I'm<br>
        not sure<br>
                             (a) whether the<br>
                             added const_cast is really deemed<br>
        appropriate here<br>
                             (though I guess so,<br>
                             given the large number of existing similar<br>
                             const_casts across<br>
                             ASTContext.cpp), and (b) what the preferred way<br>
                             would be to break that<br>
                             long line. ;)<br>
<br>
<br>
                     Hi Stephan,<br>
<br>
                     I wrote the buildImplicitRecord() utility, and in<br>
        principle the<br>
                     attribute could be added centrally to that function<br>
        -- if<br>
                     these are<br>
                     the semantics we want for most built-in types, as you<br>
                     suggest, it<br>
                     makes sense to centralize the decision.<br>
<br>
                     Another option would be to calculate the special<br>
        linkage in<br>
                     computeLVForDecl() instead of using an attribute,<br>
        but it doesn't<br>
                     really matter either way I think as the result is<br>
        the same.<br>
<br>
                     The bigger question is whether (1) default<br>
        visibility is<br>
                     correct for<br>
                     all built-in types currently being generated by<br>
                     buildImplicitRecord()<br>
                     and (2) whether this is a valid choice for all<br>
        targets we<br>
                     support<br>
                     including MSVC drop-in compatibility mode.<br>
<br>
                     To help answer question (1), the affected built-in<br>
        types<br>
                     would be:<br>
<br>
                     lib/AST/ASTContext.cpp:    Float128StubDecl =<br></div></div>
                     buildImplicitRecord("______<u></u>float128");<br>
                     lib/AST/ASTContext.cpp:    CFConstantStringTypeDecl =<br>
                     buildImplicitRecord("____<u></u>NSConstantString");<br>
                     lib/AST/ASTContext.cpp:    RecordDecl<br>
        *ObjCSuperTypeDecl =<br>
                     buildImplicitRecord("objc_____<u></u>super");<br>
                     lib/AST/ASTContext.cpp:  RD =<br>
                     buildImplicitRecord("__block__<u></u>___descriptor");<br>
                     lib/AST/ASTContext.cpp:  RD =<br>
<br>
        buildImplicitRecord("__block__<u></u>___descriptor_withcopydispose"<u></u>);<br>
                     lib/AST/ASTContext.cpp:  RecordDecl *VaListTagDecl =<br>
                     Context->buildImplicitRecord("<u></u>______va_list");<br>
                     lib/AST/ASTContext.cpp:  VaListTagDecl =<br>
                     Context->buildImplicitRecord("<u></u>______va_list_tag");<br>
                     lib/AST/ASTContext.cpp:  VaListTagDecl =<br>
                     Context->buildImplicitRecord("<u></u>______va_list_tag");<br>
                     lib/AST/ASTContext.cpp:  RecordDecl *VaListDecl =<br>
                     Context->buildImplicitRecord("<u></u>______va_list");<br>
                     lib/AST/ASTContext.cpp:  VaListTagDecl =<br>
                     Context->buildImplicitRecord("<u></u>______va_list_tag");<br>
                     lib/CodeGen/CodeGenModule.cpp:    RecordDecl *D =<br>
                     Context.buildImplicitRecord("_<u></u>_____builtin_NSString");<br>
                     lib/CodeGen/CodeGenModule.cpp:    RecordDecl *D =<br>
<br>
        Context.buildImplicitRecord("_<u></u>_____objcFastEnumerationState"<u></u>);<br>
                     lib/Sema/Sema.cpp:<br>
<br>
        PushOnScopeChains(Context.____<u></u>buildImplicitRecord("type_____<u></u>info",<span class=""><br>
                     TTK_Class),<br>
<br>
<br>
                 There are also the implicit typedefs -- I don't know<br>
        what the<br>
                 visibility/export deal is for those:<br>
<br>
<br>
                 lib/AST/ASTContext.cpp:    Int128Decl =<br>
                 buildImplicitTypedef(Int128Ty,<br>
                 "__int128_t");<br>
                 lib/AST/ASTContext.cpp:    UInt128Decl =<br></span>
                 buildImplicitTypedef(____<u></u>UnsignedInt128Ty, "__uint128_t");<br>
                 lib/AST/ASTContext.cpp:<br>
                 buildImplicitTypedef(____<u></u>getObjCIdType(),<span class=""><br>
                 "instancetype");<br>
                 lib/AST/ASTContext.cpp:    ObjCIdDecl =<br>
        buildImplicitTypedef(T,<br>
                 "id");<br>
                 lib/AST/ASTContext.cpp:    ObjCSelDecl =<br>
        buildImplicitTypedef(T,<br>
                 "SEL");<br>
                 lib/AST/ASTContext.cpp:    ObjCClassDecl =<br>
        buildImplicitTypedef(T,<br>
                 "Class");<br>
                 lib/AST/ASTContext.cpp:  return<br></span>
        Context->buildImplicitTypedef(<u></u>____T,<br>
                 "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:  return<br>
        Context->buildImplicitTypedef(<u></u>____T,<br>
                 "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:  return<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagType,<br>
        "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagType,<br>
                 "__va_list_tag");<br>
                 lib/AST/ASTContext.cpp:  return<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagArrayType,<br>
                 "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagType,<br>
                 "__va_list_tag");<br>
                 lib/AST/ASTContext.cpp:  return<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagArrayType,<br>
                 "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:  return<br>
                 Context->buildImplicitTypedef(<u></u>____IntArrayType,<br>
        "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:  return<br>
        Context->buildImplicitTypedef(<u></u>____T,<br>
                 "__builtin_va_list");<br>
                 lib/AST/ASTContext.cpp:<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagType,<br>
                 "__va_list_tag");<br>
                 lib/AST/ASTContext.cpp:  return<br>
                 Context->buildImplicitTypedef(<u></u>____VaListTagArrayType,<br>
                 "__builtin_va_list");<br>
                 lib/Sema/Sema.cpp:<br>
                 PushOnScopeChains(Context.____<u></u>buildImplicitTypedef(T,<span class=""><br>
                 Name), TUScope);<br>
<br>
                 Alp.<br>
<br>
<br>
                     I'll need help answering those questions from<br>
                     linkage/visibility folks<br>
                     on the list before going forward with a change like<br>
        this.<br>
<br>
                     Thanks<br>
                     Alp.<br>
</span></blockquote>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>