Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -3034,10 +3034,8 @@ else Flags |= llvm::DINode::FlagTypePassByValue; - // Record if a C++ record is trivial type. - if (CXXRD->isTrivial()) - Flags |= llvm::DINode::FlagTrivial; - else + // Record if a C++ record is non-trivial type. + if (!CXXRD->isTrivial()) Flags |= llvm::DINode::FlagNonTrivial; } Index: test/CodeGenCXX/debug-info-composite-triviality.cpp =================================================================== --- test/CodeGenCXX/debug-info-composite-triviality.cpp +++ test/CodeGenCXX/debug-info-composite-triviality.cpp @@ -23,44 +23,6 @@ // CHECK-DAG: !DIGlobalVariable(name: "GlobalVar", {{.*}}type: {{.*}}, isLocal: false, isDefinition: true) int GlobalVar = 0; -// Cases to test composite type's triviality - -// CHECK-DAG: !DICompositeType({{.*}}, name: "Union",{{.*}}flags: {{.*}}DIFlagTrivial -union Union { - int a; -} Union; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "Trivial",{{.*}}flags: {{.*}}DIFlagTrivial -struct Trivial { - int i; -} Trivial; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "TrivialA",{{.*}}flags: {{.*}}DIFlagTrivial -struct TrivialA { - TrivialA() = default; -} TrivialA; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "TrivialB",{{.*}}flags: {{.*}}DIFlagTrivial -struct TrivialB { - int m; - TrivialB(int x) { m = x; } - TrivialB() = default; -} TrivialB; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "TrivialC",{{.*}}flags: {{.*}}DIFlagTrivial -struct TrivialC { - struct Trivial x; -} TrivialC; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "TrivialD",{{.*}}flags: {{.*}}DIFlagTrivial -struct NT { - NT() {}; -}; -struct TrivialD { - static struct NT x; // Member is non-trivial but is static. -} TrivialD; - - // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivial",{{.*}}flags: {{.*}}DIFlagNonTrivial struct NonTrivial { NonTrivial() {} @@ -84,7 +46,3 @@ // CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialD",{{.*}}flags: {{.*}}DIFlagNonTrivial struct NonTrivialD : NonTrivial { } NonTrivialD; - -// CHECK-DAG: !DICompositeType({{.*}}, name: "NonTrivialE",{{.*}}flags: {{.*}}DIFlagNonTrivial -struct NonTrivialE : Trivial, NonTrivial { -} NonTrivialE;