Pārlūkot izejas kodu

Add addBaseSubobjectTypeName which isn't used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129671 91177308-0d34-0410-b5e6-96231b3b80d8
Anders Carlsson 14 gadi atpakaļ
vecāks
revīzija
6aed2a1e4b
2 mainītis faili ar 14 papildinājumiem un 0 dzēšanām
  1. 9 0
      lib/CodeGen/CodeGenTypes.cpp
  2. 5 0
      lib/CodeGen/CodeGenTypes.h

+ 9 - 0
lib/CodeGen/CodeGenTypes.cpp

@@ -511,6 +511,15 @@ CodeGenTypes::getCGRecordLayout(const RecordDecl *RD) {
   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)

+ 5 - 0
lib/CodeGen/CodeGenTypes.h

@@ -150,6 +150,11 @@ public:
 
   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);