Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread Eric Christopher via cfe-commits
On Tue, Jul 31, 2018 at 3:59 PM wrote: > What might be missing is the impl of CreateMemberType: > > llvm::DIType *CGDebugInfo::CreateMemberType(llvm::DIFile *Unit, QualType > FType, > StringRef Name, uint64_t > *Offset) { >llvm::DIType *FieldTy = C

Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread via cfe-commits
What might be missing is the impl of CreateMemberType: llvm::DIType *CGDebugInfo::CreateMemberType(llvm::DIFile *Unit, QualType FType, StringRef Name, uint64_t *Offset) { llvm::DIType *FieldTy = CGDebugInfo::getOrCreateType(FType, Unit); uint64_t

Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread Eric Christopher via cfe-commits
I'm probably missing something, from looking here: FieldOffset = 0; if (CGM.getLangOpts().OpenCL) { FType = CGM.getContext().IntTy; EltTys.push_back(CreateMemberType(Unit, FType, "__size", &FieldOffset)); EltTys.push_back(CreateMemberType(Unit, FType, "__align", &FieldOffset)); }

Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread via cfe-commits
I think this version is right; the FieldOffset for OpenCL here will be 2 * getTypeSize(IntTy). The final `FieldOffset += FieldSize` that was moved only applies to the non-OpenCL "__descriptor" field. Scott On 2018-07-30 19:22, Eric Christopher wrote: Is 0 right for FieldOffset for OpenCL here

Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-30 Thread Eric Christopher via cfe-commits
Is 0 right for FieldOffset for OpenCL here? Seems a little odd. -eric On Mon, Jul 30, 2018 at 3:56 PM Scott Linder via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: scott.linder > Date: Mon Jul 30 15:52:07 2018 > New Revision: 338321 > > URL: http://llvm.org/viewvc/llvm-project?rev=