From cbcb030ab33d23c5f7e2e76e2e36843cb5295d50 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 15 Aug 2013 22:50:29 +0000 Subject: [PATCH] DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188501 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 15 +++++++-------- lib/CodeGen/CGDebugInfo.h | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 5f56e16959..0c6f549e21 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -866,10 +866,9 @@ CollectRecordLambdaFields(const CXXRecordDecl *CXXDecl, } /// CollectRecordStaticField - Helper for CollectRecordFields. -void CGDebugInfo:: -CollectRecordStaticField(const VarDecl *Var, - SmallVectorImpl &elements, - llvm::DIType RecordTy) { +llvm::DIDerivedType +CGDebugInfo::CreateRecordStaticField(const VarDecl *Var, + llvm::DIType RecordTy) { // Create the descriptor for the static variable, with or without // constant initializers. llvm::DIFile VUnit = getOrCreateFile(Var->getLocation()); @@ -898,10 +897,10 @@ CollectRecordStaticField(const VarDecl *Var, else if (Access == clang::AS_protected) Flags |= llvm::DIDescriptor::FlagProtected; - llvm::DIType GV = DBuilder.createStaticMemberType(RecordTy, VName, VUnit, - LineNumber, VTy, Flags, C); - elements.push_back(GV); + llvm::DIDerivedType GV = DBuilder.createStaticMemberType( + RecordTy, VName, VUnit, LineNumber, VTy, Flags, C); StaticDataMemberCache[Var->getCanonicalDecl()] = llvm::WeakVH(GV); + return GV; } /// CollectRecordNormalField - Helper for CollectRecordFields. @@ -952,7 +951,7 @@ CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit, for (RecordDecl::decl_iterator I = record->decls_begin(), E = record->decls_end(); I != E; ++I) if (const VarDecl *V = dyn_cast(*I)) - CollectRecordStaticField(V, elements, RecordTy); + elements.push_back(CreateRecordStaticField(V, RecordTy)); else if (FieldDecl *field = dyn_cast(*I)) { CollectRecordNormalField(field, layout.getFieldOffset(fieldNo), tunit, elements, RecordTy); diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index 6c4c34c368..c3d2834234 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -184,9 +184,8 @@ class CGDebugInfo { void CollectRecordLambdaFields(const CXXRecordDecl *CXXDecl, SmallVectorImpl &E, llvm::DIType RecordTy); - void CollectRecordStaticField(const VarDecl *Var, - SmallVectorImpl &E, - llvm::DIType RecordTy); + llvm::DIDerivedType CreateRecordStaticField(const VarDecl *Var, + llvm::DIType RecordTy); void CollectRecordNormalField(const FieldDecl *Field, uint64_t OffsetInBits, llvm::DIFile F, SmallVectorImpl &E, -- 2.40.0