summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/visibility.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rework the visibility computation algorithm in preparationJohn McCall2013-02-161-15/+29
| | | | | | | | | | | | | | | | for distinguishing type vs. value visibility. The changes to the visibility of explicit specializations are intentional. The change to the "ugly" test case is a consequence of a sensible implementation, and I am happy to argue that this is better behavior. Other changes may or may not be intended; it is quite difficult to divine intent from some of the code I altered. I've left behind a comment which I hope explains the philosophy behind visibility computation. llvm-svn: 175326
* Disable caching of visibility.Rafael Espindola2013-01-121-0/+44
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Consider the visibility of template template arguments. GCC doesn't, but it alsoRafael Espindola2012-07-311-0/+18
| | | | | | fails to consider the linkage, which we were already considering. llvm-svn: 161070
* Add a missing testcase for merging the visibility of two declarations usedRafael Espindola2012-07-281-0/+17
| | | | | | as arguments of a template. llvm-svn: 160911
* Record visibility pragmas when we see a tag declaration. We might use itRafael Espindola2012-07-171-0/+16
| | | | | | to build a type before seeing the definition. llvm-svn: 160339
* Apply visibility pragmas to class template declarations. This is needed becauseRafael Espindola2012-07-131-0/+17
| | | | | | we might use the declaration to build a type before seeing the definition. llvm-svn: 160176
* Fix a bug in my previous commit. The problem is not that we were not using theRafael Espindola2012-07-131-0/+13
| | | | | | | canonical decl for the template, but that we were not merging attributes for templates at all! llvm-svn: 160157
* Use the canonical template decl when trying to find if it has a visibilityRafael Espindola2012-07-121-0/+13
| | | | | | attribute. llvm-svn: 160139
* Process #pragma visibility early in the parsing of class definitions. FixesRafael Espindola2012-07-121-0/+17
| | | | | | pr13338. llvm-svn: 160105
* Handle #pragma visibility in explicit specializations and enums.Rafael Espindola2012-07-111-0/+14
| | | | llvm-svn: 160057
* Don't process #pragma visibility during instantiation. The visibility of theRafael Espindola2012-07-111-0/+13
| | | | | | | instantiation depends on the template, its arguments and parameters, but not where it is instantiated. llvm-svn: 160034
* We were computing the visibility and linkage of template parameters, butRafael Espindola2012-06-111-2/+95
| | | | | | | | | only using the linkage. Use and test both, documenting that considering the visibility and linkage of template parameters is a difference from gcc. llvm-svn: 158309
* Don't ignore linkage when ignoring visibility in the instantiation of aRafael Espindola2012-05-251-0/+17
| | | | | | method template. llvm-svn: 157486
* Don't ignore linkage when ignoring visibility in the instantiation of aRafael Espindola2012-05-251-0/+15
| | | | | | function template. llvm-svn: 157480
* Consider the linkage for member class templates even when we have to ignoreRafael Espindola2012-05-251-0/+17
| | | | | | the visibility. llvm-svn: 157475
* When ignoring visibility in an instantiation, still consider the linkage.Rafael Espindola2012-05-251-0/+14
| | | | | | | Similar fixes for function and member template to follow as I write the testcases. llvm-svn: 157470
* Function template version of the previous patch.Rafael Espindola2012-05-211-0/+13
| | | | llvm-svn: 157207
* Produce a hidden symbol for zed inRafael Espindola2012-05-211-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct HIDDEN foo { }; template <class P> struct bar { }; template <> struct HIDDEN bar<foo> { DEFAULT static void zed(); }; void bar<foo>::zed() { } Before we would produce a hidden symbol in struct HIDDEN foo { }; template <class P> struct bar { }; template <> struct bar<foo> { DEFAULT static void zed(); }; void bar<foo>::zed() { } But adding HIDDEN to the specialization would cause us to produce a default symbol. llvm-svn: 157206
* Test and document a difference from gcc in the handling of visibilityRafael Espindola2012-05-211-0/+13
| | | | | | attributes. llvm-svn: 157186
* Fix the visibility of instantiations of static data members.Rafael Espindola2012-05-161-0/+12
| | | | | | Fixes pr12835. llvm-svn: 156897
* Fix our handling of visibility in explicit template instantiations.Rafael Espindola2012-05-151-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | * Don't copy the visibility attribute during instantiations. We have to be able to distinguish struct HIDDEN foo {}; template<class T> DEFAULT void bar() {} template DEFAULT void bar<foo>(); from struct HIDDEN foo {}; template<class T> DEFAULT void bar() {} template void bar<foo>(); * If an instantiation has an attribute, it takes precedence over an attribute in the template. * With instantiation attributes handled with the above logic, we can now select the minimum visibility when looking at template arguments. llvm-svn: 156821
* Fix visibility when we have two types with explicit visibility in a templateRafael Espindola2012-04-231-0/+12
| | | | | | argument list. llvm-svn: 155368
* Add another testcase that was not being covered.Rafael Espindola2012-04-231-0/+18
| | | | llvm-svn: 155351
* Add a testcase that we already get right but was not being tested. FoundRafael Espindola2012-04-221-0/+10
| | | | | | | by a chrome build on OS X. Thanks to Nico Weber for testing a patch and providing the .ii file. llvm-svn: 155326
* Cleanup testcase.Rafael Espindola2012-04-221-3/+2
| | | | llvm-svn: 155317
* An attribute in a explicit template installation should take precedence overRafael Espindola2012-04-221-0/+13
| | | | | | | | | | | the tempale arguments in deciding the visibility. This agrees with gcc 4.7. Found by trying to build chrome with component=shared_library with 155314 reverted. llvm-svn: 155316
* Revert 155102 but add a fixme while I debug what is wrong with chrome'sRafael Espindola2012-04-221-2/+6
| | | | | | components build. llvm-svn: 155314
* Add another missing testcase.Rafael Espindola2012-04-221-0/+12
| | | | llvm-svn: 155304
* Add a testcase we were already getting right, but were not testing for.Rafael Espindola2012-04-221-0/+13
| | | | llvm-svn: 155302
* Fix handling of template parameters. Found by inspection. GCC 4.7 agreesRafael Espindola2012-04-221-0/+14
| | | | | | with this testcase. llvm-svn: 155301
* In mergeVisibility, if we already have an explicit visibility, keep it.Rafael Espindola2012-04-191-0/+12
| | | | | | | | This fixes the included testcase and lets us simplify the code a bit. It does require using mergeWithMin when merging class information to its members. Expand the comments to explain why that works. llvm-svn: 155103
* In mergeVisibilityWithMin, let an implicit hidden symbol take precedence overRafael Espindola2012-04-191-2/+2
| | | | | | | | | | | | | | | | an explicit default one. This means that with -fvisibility hidden we now produce a hidden symbol for template <typename T> class DEFAULT foo { void bar() {} }; class zed {}; template class foo<zed>; This matches the behaviour of gcc 4.7. llvm-svn: 155102
* Revert r154749 for now at John McCall's request.Rafael Espindola2012-04-161-12/+0
| | | | llvm-svn: 154846
* Consider visibility attributes last, so that they take precedence.Rafael Espindola2012-04-141-0/+12
| | | | | | I am working on a cleaner fix, but this gets the case in PR12552 passing. llvm-svn: 154749
* The type of a definition should not increase its visibility. Fixes PR12221.Rafael Espindola2012-03-101-0/+8
| | | | llvm-svn: 152493
* Two fixes to how we compute visibility:Rafael Espindola2012-02-231-0/+97
| | | | | | | | | | | | * Handle some situations where we should never make a decl more visible, even when merging in an explicit visibility. * Handle attributes in members of classes that are explicitly specialized. Thanks Nico for the report and testing, Eric for the initial review, and dgregor for the awesome test27 :-) llvm-svn: 151236
* Remember if a type has its visibility set explicitly or implicitly.Rafael Espindola2012-01-141-5/+24
| | | | | | | | With that, centralize the way we merge visibility, always preferring explicit over implicit and then picking the most restrictive one. Fixes pr10113 and pr11690. llvm-svn: 148163
* Process attributes in explicit function template instantiations. Fixes part ofRafael Espindola2012-01-041-0/+5
| | | | | | PR11690. llvm-svn: 147523
* Process attributes in explicit template instatiation definitions. Fixes PR11690.Rafael Espindola2012-01-031-0/+10
| | | | llvm-svn: 147441
* Small cosmetic cleanups in code I will change anyway.Rafael Espindola2012-01-021-1/+1
| | | | llvm-svn: 147424
* Consider visibility attributes in namespaces as being explicit. I.e., theyRafael Espindola2012-01-011-0/+12
| | | | | | take precedence over command line options. Fixes PR10113. llvm-svn: 147405
* Remove a non-gcc-compatible extension that would apply attributes on ↵Eli Friedman2011-12-171-1/+1
| | | | | | declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han. llvm-svn: 146796
* Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGenPeter Collingbourne2011-09-261-1/+1
| | | | llvm-svn: 140503
* Don't factor in visibility for templates and template argumentsJohn McCall2011-06-271-0/+32
| | | | | | for explicit specializations with their own explicit visibility. llvm-svn: 133958
* Don't consider visibility from template parameter lists if we'reJohn McCall2011-03-041-0/+11
| | | | | | | | | computing for a nested decl with explicit visibility. This is all part of the general philosophy of explicit visibility attributes, where any information that was obviously available at the attribute site should probably be ignored. Fixes PR9371. llvm-svn: 126992
* Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the ↵Anders Carlsson2011-01-241-1/+1
| | | | | | | | exception of explicit template instantiations, which have to be weak_odr. This fixes PR6996. llvm-svn: 124089
* Also set unnamed_addr on declarations.Rafael Espindola2011-01-151-2/+2
| | | | llvm-svn: 123531
* Only add unnamed_addr to definitions.Rafael Espindola2011-01-131-2/+2
| | | | llvm-svn: 123354
* Set unnamed_addr in VTTs.Rafael Espindola2011-01-111-1/+1
| | | | llvm-svn: 123280
* Add unnamed_addr to vtables.Rafael Espindola2011-01-111-2/+2
| | | | llvm-svn: 123272
OpenPOWER on IntegriCloud