diff options
author | Keno Fischer <kfischer@college.harvard.edu> | 2015-11-16 09:04:13 +0000 |
---|---|---|
committer | Keno Fischer <kfischer@college.harvard.edu> | 2015-11-16 09:04:13 +0000 |
commit | 87842f3b4e27345dad158b4820c86b00aa180e38 (patch) | |
tree | c0d9883d23eab2f574d6dd885f01055b43294086 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 83709b1c1e149cd322eb45ac5efc5c40324dd2d2 (diff) | |
download | bcm5719-llvm-87842f3b4e27345dad158b4820c86b00aa180e38.tar.gz bcm5719-llvm-87842f3b4e27345dad158b4820c86b00aa180e38.zip |
[CGDebugInfo] Set the size and align for reference types
In r253186, I changed the DIBuilder API to now take size and align
for reference types as well. This was done in preparation for upcoming
changes to the Verifier that will validate that sizes match between
DI types and IR values that are declared as having those types.
This updates clang to actually pass the information through.
llvm-svn: 253190
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 30a184cf638..582fb730779 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -712,10 +712,6 @@ llvm::DIType *CGDebugInfo::CreatePointerLikeType(llvm::dwarf::Tag Tag, const Type *Ty, QualType PointeeTy, llvm::DIFile *Unit) { - if (Tag == llvm::dwarf::DW_TAG_reference_type || - Tag == llvm::dwarf::DW_TAG_rvalue_reference_type) - return DBuilder.createReferenceType(Tag, getOrCreateType(PointeeTy, Unit)); - // Bit size, align and offset of the type. // Size is always the size of a pointer. We can't use getTypeSize here // because that does not return the correct value for references. @@ -723,8 +719,13 @@ llvm::DIType *CGDebugInfo::CreatePointerLikeType(llvm::dwarf::Tag Tag, uint64_t Size = CGM.getTarget().getPointerWidth(AS); uint64_t Align = CGM.getContext().getTypeAlign(Ty); - return DBuilder.createPointerType(getOrCreateType(PointeeTy, Unit), Size, - Align); + if (Tag == llvm::dwarf::DW_TAG_reference_type || + Tag == llvm::dwarf::DW_TAG_rvalue_reference_type) + return DBuilder.createReferenceType(Tag, getOrCreateType(PointeeTy, Unit), + Size, Align); + else + return DBuilder.createPointerType(getOrCreateType(PointeeTy, Unit), Size, + Align); } llvm::DIType *CGDebugInfo::getOrCreateStructPtrType(StringRef Name, |