Add addBaseSubobjectTypeName which isn't used yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129671 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 3ec43f2..f802b07 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -511,6 +511,15 @@
return *Layout;
}
+void CodeGenTypes::addBaseSubobjectTypeName(const CXXRecordDecl *RD,
+ const CGRecordLayout &layout) {
+ llvm::StringRef suffix;
+ if (layout.getBaseSubobjectLLVMType() != layout.getLLVMType())
+ suffix = ".base";
+
+ addTagTypeName(RD, layout.getBaseSubobjectLLVMType(), suffix);
+}
+
bool CodeGenTypes::isZeroInitializable(QualType T) {
// No need to check for member pointers when not compiling C++.
if (!Context.getLangOptions().CPlusPlus)
diff --git a/lib/CodeGen/CodeGenTypes.h b/lib/CodeGen/CodeGenTypes.h
index 6dd4d7b..a0e1caa 100644
--- a/lib/CodeGen/CodeGenTypes.h
+++ b/lib/CodeGen/CodeGenTypes.h
@@ -150,6 +150,11 @@
const CGRecordLayout &getCGRecordLayout(const RecordDecl*);
+ /// addBaseSubobjectTypeName - Add a type name for the base subobject of the
+ /// given record layout.
+ void addBaseSubobjectTypeName(const CXXRecordDecl *RD,
+ const CGRecordLayout &layout);
+
/// UpdateCompletedType - When we find the full definition for a TagDecl,
/// replace the 'opaque' type we previously made for it if applicable.
void UpdateCompletedType(const TagDecl *TD);