summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/static-member-variable-explicit-specialization.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make this test a bit stricter.Rafael Espindola2015-01-051-7/+7
| | | | | | | The first function is named __cxx_global_var_init, which is a substring of the following functions @__cxx_global_var_init(1,2,3,etc). llvm-svn: 225191
* Don't use a global_ctors comdat for globals that aren't externally visibleReid Kleckner2014-10-151-1/+15
| | | | | | | | In particular, if you have two identical templates in different TUs in anonymous namespaces, we would use the same global_ctors comdat key for both. As a result, only one would be run. llvm-svn: 219806
* Revert "Don't use comdats for initializers on platforms that don't support it"Reid Kleckner2014-09-231-1/+1
| | | | | | | | | On further investigation, COMDATs should work with .ctors, and the issue I was hitting probably reproduces with .init_array. This reverts commit r218287. llvm-svn: 218313
* Don't use comdats for initializers on platforms that don't support itReid Kleckner2014-09-231-1/+1
| | | | | | | | | In particular, pre-.init_array ELF uses the .ctors section mechanism. MinGW COFF also uses .ctors, now that I think about it. Therefore, restrict this optimization to the two platforms that are currently known to work: ELF with .init_array and COFF with .CRT$XCU. llvm-svn: 218287
* Don't use the third field of llvm.global_ctors for MachO.Rafael Espindola2014-09-191-53/+68
| | | | | | | | | | The field is defined as: If the third field is present, non-null, and points to a global variable or function, the initializer function will only run if the associated data from the current module is not discarded. And without COMDATs we can't implement that. llvm-svn: 218097
* Use comdats to avoid double initialization of weak dataReid Kleckner2014-05-231-8/+8
| | | | | | | | | | | | | | | | | Initializers of global data that can appear multiple TUs (static data members of class templates or __declspec(selectany) data) are now in a comdat group keyed on the global variable being initialized. On non-Windows platforms, this is a code size and startup time optimization. On Windows, this is necessary for ABI compatibility with MSVC. Fixes PR16959. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3811 llvm-svn: 209555
* Include translation unit filename in global ctor symbol names.Nico Weber2014-05-061-3/+3
| | | | | | | | | | | | | | | | | This makes it easier to see where a global ctor comes from, and it also makes ASan's init order analyzer output easier to understand. gcc does this too, but only in -fPIC mode for some reason. Don't do this for constructors with explicit init priority. Also prepend "sub_" before the 'I', that way regular constructors stay lexicographically after symbols with init priority (because ord('s') > ord('I')). gold seems to ignore the name of constructor symbols, and ld only looks at the symbol if it includes an init priority, which this patch doesn't change. Before: __GLOBAL_I_a Now: __GLOBAL_sub_I_myfile.cc llvm-svn: 208128
* Implement restriction that a partial specialization must actually specializeRichard Smith2013-09-241-1/+1
| | | | | | something, for variable templates. llvm-svn: 191278
* Do not emit duplicate global initializers for template static data members ↵David Blaikie2013-09-041-3/+28
| | | | | | | | | | | | | | | | | inside namespaces A quirk of AST representation leads to class template static data member definitions being visited twice during Clang IRGen resulting in duplicate (benign) initializers. Discovered while investigating a possibly-related debug info bug tickled by the duplicate emission of these members & their associated debug info. With thanks to Richard Smith for help investigating, understanding, and helping with the fix. llvm-svn: 189996
* Order initializers of static data members of explicit specializationsReid Kleckner2013-09-041-8/+43
| | | | | | | | I tried to implement this properly in r189051, but I didn't have enough test coverage. Richard kindly provided more test cases than I could possibly imagine and now we should have the correct condition. llvm-svn: 189898
* Add a separate llvm.global_ctors entry for linkonce_odr data initializersReid Kleckner2013-08-221-0/+25
| | | | | | | | | | | | | | | Summary: These typically come from static data members of class template specializations. This accomplishes two things: 1. May expose GlobalOpt optimizations for Itanium C++ ABI code. 2. Works toward fixing double initialization in the Microsoft C++ ABI. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1475 llvm-svn: 189051
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Don't emit explicit specializations of static member variable declarations.Anders Carlsson2009-12-041-0/+11
llvm-svn: 90624
OpenPOWER on IntegriCloud