Commit Graph

7 Commits

Author SHA1 Message Date
John McCall 386dfc738e static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled).  This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.

llvm-svn: 114269
2010-09-18 05:25:11 +00:00
John McCall 7a626f63f7 one piece of code is responsible for the lifetime of every aggregate
slot.  The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision.  The main obstacle here is that
IR-generation must be much more careful about making sure that exactly

llvm-svn: 113962
2010-09-15 10:14:12 +00:00
Sebastian Redl 02f1eebdc0 Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.
llvm-svn: 113344
2010-09-08 04:46:19 +00:00
Anders Carlsson 4013404eff Static local variables don't result in global constructors being emitted.
llvm-svn: 112933
2010-09-03 01:11:38 +00:00
John McCall 8b0f4ff317 Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.

llvm-svn: 110063
2010-08-02 21:13:48 +00:00
John McCall 81c9cea24b Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.

llvm-svn: 109986
2010-08-01 21:51:45 +00:00
John McCall 47e40931c9 Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.

llvm-svn: 109984
2010-08-01 20:20:59 +00:00