Commit Graph

18 Commits

Author SHA1 Message Date
Eli Friedman 84d2812111 Re-commit r139643.
Make clang use Acquire loads and Release stores where necessary.

llvm-svn: 139650
2011-09-13 22:21:56 +00:00
Eli Friedman acca089617 Revert r139643 while I look into it; it's breaking selfhost.
llvm-svn: 139648
2011-09-13 22:08:16 +00:00
Eli Friedman f92b2e0714 Make clang use Acquire loads and Release stores where necessary.
llvm-svn: 139643
2011-09-13 21:31:32 +00:00
John McCall 5aa5259f5e Perform an acquire memory barrier on the fast path of a thread-safe
static initializer check, as required by the Itanium ABI.

llvm-svn: 133250
2011-06-17 07:33:57 +00:00
John McCall 8f9a42971e Fix a test case and teach ClearLinkageCache() to clear the linkage of
a function template decl's pattern, which was suddenly exposed by my
last patch.

llvm-svn: 128073
2011-03-22 06:58:49 +00:00
John McCall 68ff03728a Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.

llvm-svn: 113330
2010-09-08 01:44:27 +00:00
Rafael Espindola e971b9a260 Correctly align large arrays in x86-64. This fixes PR5599.
llvm-svn: 105500
2010-06-04 23:15:27 +00:00
John McCall 7cb0220e53 If a function definition has any sort of weak linkage, its static local
variables should have that linkage.  Otherwise, its static local
variables should have internal linkage.  To avoid computing this excessively,
set a function's linkage before we emit code for it.

Previously we were assigning weak linkage to the static variables of
static inline functions in C++, with predictably terrible results.  This
fixes that and also gives better linkage than 'weak' when merging is required.

llvm-svn: 104581
2010-05-25 04:30:21 +00:00
Douglas Gregor 370eadf38d For thread-safe static initialization of local statics with
destructors, place the __cxa_atexit call after the __cxa_guard_release
call, mimicking GCC/LLVM-GCC behavior. Noticed while debugging
something related.

llvm-svn: 103088
2010-05-05 15:38:32 +00:00
John McCall 5828ee7a27 Just bail out immediately when emitting an unreachable function-local static
variable.  Surprisingly, this does seem to be the right way to solve this.

llvm-svn: 102961
2010-05-03 21:39:56 +00:00
Anders Carlsson cee2d2f016 Use the right linkage for static variables inside C++ inline functions.
llvm-svn: 95512
2010-02-07 02:03:08 +00:00
Anders Carlsson 20bbbd489b Make sure to always mark a global variable as not being constant if it has a C++ initializer.
llvm-svn: 94504
2010-01-26 04:02:23 +00:00
Nuno Lopes 13c88c7269 implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.
feel free to chage the name to this lengthy argument

llvm-svn: 91543
2009-12-16 16:59:22 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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
2009-12-15 20:14:24 +00:00
Anders Carlsson a72ddd4609 Handle emitting static variables that have reference type.
llvm-svn: 91027
2009-12-10 01:05:11 +00:00
Daniel Dunbar 8b57697954 Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
2009-11-08 01:45:36 +00:00
Dan Gohman 43b4484f87 Use the inbounds variant of getelementptr for common pointer arithmetic.
llvm-svn: 78756
2009-08-12 00:33:55 +00:00
Anders Carlsson f40886acca Refactor some code and implement support for global destructors for static variables.
llvm-svn: 78507
2009-08-08 21:45:14 +00:00