Commit Graph

9 Commits

Author SHA1 Message Date
James Molloy e943003c09 Ensure that default arguments are handled correctly in sub scopes. For example:
void f () {
  int g (int a, int b=4);
  {
    int g(int a, int b=5);
  }
}

should compile.

llvm-svn: 152621
2012-03-13 08:55:35 +00:00
Rafael Espindola 05842dabb8 Move unnamed_addr after the function arguments on Sabre's request.
llvm-svn: 124210
2011-01-25 19:10:24 +00:00
Rafael Espindola 0ee986c1f1 Add unnamed_addr to constructors and destructors.
llvm-svn: 123197
2011-01-11 00:26:26 +00:00
John McCall f8ff7b9fd1 Perform two more constructor/destructor code-size optimizations:
1) emit base destructors as aliases to their unique base class destructors
under some careful conditions.  This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor.  This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.

llvm-svn: 96842
2010-02-23 00:48:20 +00:00
John McCall 334ce7c1c4 Revert the ctor/dtor alias optimization for now; the buildbots can detect
some failure here that I can't.

llvm-svn: 96612
2010-02-18 21:31:48 +00:00
John McCall 67cea74745 Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes.  We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.

llvm-svn: 96451
2010-02-17 03:52:49 +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 3a202f601e Handle cases where we're constructing an array of objects and the constructor has default arguments.
llvm-svn: 89783
2009-11-24 18:43:52 +00:00
Anders Carlsson 52ce3bbf57 Handle CXXDefaultArgExprs in EmitLValue. Fixes PR5484.
llvm-svn: 88735
2009-11-14 01:51:50 +00:00