[CodeGen] Record if a C++ record is a trivial type
authorAaron Smith <aaron.smith@microsoft.com>
Mon, 23 Jul 2018 20:49:07 +0000 (20:49 +0000)
committerAaron Smith <aaron.smith@microsoft.com>
Mon, 23 Jul 2018 20:49:07 +0000 (20:49 +0000)
Summary: This has a dependence on D45122

Reviewers: rnk, zturner, llvm-commits, aleksandr.urakov

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45124

llvm-svn: 337736

clang/lib/CodeGen/CGDebugInfo.cpp

index 10fc22a098cfd51763deb0579f700f36b601a182..097a1e0430479589685ff8829c6f10ba3730f27e 100644 (file)
@@ -2908,6 +2908,10 @@ llvm::DICompositeType *CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
       Flags |= llvm::DINode::FlagTypePassByReference;
     else
       Flags |= llvm::DINode::FlagTypePassByValue;
+
+    // Record if a C++ record is trivial type.
+    if (CXXRD->isTrivial())
+      Flags |= llvm::DINode::FlagTrivial;
   }
 
   llvm::DICompositeType *RealDecl = DBuilder.createReplaceableCompositeType(