summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-12-23 19:11:47 +0000
committerAdrian Prantl <aprantl@apple.com>2014-12-23 19:11:47 +0000
commit48af2ef40feba3cccfd5cf951b7937c1f5f11947 (patch)
treeb2fe0482466b16d32509175fbb33e2ca1c0bd46b /llvm
parentd38920891ed2a29bc8fed5f802e44106f1099fde (diff)
downloadbcm5719-llvm-48af2ef40feba3cccfd5cf951b7937c1f5f11947.tar.gz
bcm5719-llvm-48af2ef40feba3cccfd5cf951b7937c1f5f11947.zip
DIBuilder: Similar to createPointerType, make createMemberPointerType take
a size and alignment. Several assertions in DwarfDebug rely on all variable types to report back a size, or to be derived from a type with a size. Tested in CFE. llvm-svn: 224780
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/DIBuilder.h6
-rw-r--r--llvm/lib/IR/DIBuilder.cpp9
2 files changed, 10 insertions, 5 deletions
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index 5482de87d6c..ae1ac650a9e 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -172,8 +172,12 @@ namespace llvm {
/// \brief Create debugging information entry for a pointer to member.
/// @param PointeeTy Type pointed to by this pointer.
+ /// @param SizeInBits Size.
+ /// @param AlignInBits Alignment. (optional)
/// @param Class Type for which this pointer points to members of.
- DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
+ DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class,
+ uint64_t SizeInBits,
+ uint64_t AlignInBits = 0);
/// createReferenceType - Create debugging information entry for a c++
/// style reference or rvalue reference type.
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 1874d31e0a5..6485ca5a003 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -328,14 +328,15 @@ DIBuilder::createPointerType(DIType PointeeTy, uint64_t SizeInBits,
return DIDerivedType(MDNode::get(VMContext, Elts));
}
-DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy,
- DIType Base) {
+DIDerivedType
+DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base,
+ uint64_t SizeInBits, uint64_t AlignInBits) {
// Pointer types are encoded in DIDerivedType format.
Metadata *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_ptr_to_member_type)
.concat(StringRef())
.concat(0) // Line
- .concat(0) // Size
- .concat(0) // Align
+ .concat(SizeInBits) // Size
+ .concat(AlignInBits) // Align
.concat(0) // Offset
.concat(0) // Flags
.get(VMContext),
OpenPOWER on IntegriCloud