Output destructors and constructors in a more natural order.

With this patch we output the in the order
C2
C1

D2
D1
D0

Which means that a destructor or constructor that call another is output after
the callee. This is a bit easier to read IHMO and a tiny bit more efficient
as we don't put a decl in DeferredDeclsToEmit.

llvm-svn: 196784
diff --git a/clang/test/CodeGenCXX/default-arguments.cpp b/clang/test/CodeGenCXX/default-arguments.cpp
index 83cae3a..d364835 100644
--- a/clang/test/CodeGenCXX/default-arguments.cpp
+++ b/clang/test/CodeGenCXX/default-arguments.cpp
@@ -42,15 +42,15 @@
  C();
 };
 
-// CHECK-LABEL: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr
-// CHECK: call void @_ZN1CC2Ev(
-
 // CHECK-LABEL: define void @_ZN1CC2Ev(%struct.C* %this) unnamed_addr
 // CHECK: call void @_ZN2A1C1Ev(
 // CHECK: call void @_ZN2A2C1Ev(
 // CHECK: call void @_ZN1BC1ERK2A1RK2A2(
 // CHECK: call void @_ZN2A2D1Ev
 // CHECK: call void @_ZN2A1D1Ev
+
+// CHECK-LABEL: define void @_ZN1CC1Ev(%struct.C* %this) unnamed_addr
+// CHECK: call void @_ZN1CC2Ev(
 C::C() { }
 
 // CHECK-LABEL: define void @_Z2f3v()