]> granicus.if.org Git - clang/commitdiff
IRgen: Move CGRecordLayout to its own happy little file.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 30 Mar 2010 22:26:10 +0000 (22:26 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 30 Mar 2010 22:26:10 +0000 (22:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CGRecordLayout.h [new file with mode: 0644]
lib/CodeGen/CGRecordLayoutBuilder.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/CodeGenTypes.h

index 66b2c086c26c929eb24267d52092cc569374bd87..c86c6aa2d6509b100975f066990b77d7645290ee 100644 (file)
@@ -14,6 +14,7 @@
 #include "CodeGenFunction.h"
 #include "CodeGenModule.h"
 #include "CGObjCRuntime.h"
+#include "CGRecordLayout.h"
 #include "clang/AST/APValue.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecordLayout.h"
diff --git a/lib/CodeGen/CGRecordLayout.h b/lib/CodeGen/CGRecordLayout.h
new file mode 100644 (file)
index 0000000..58c5f60
--- /dev/null
@@ -0,0 +1,48 @@
+//===--- CGRecordLayout.h - LLVM Record Layout Information ------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CODEGEN_CGRECORDLAYOUT_H
+#define CLANG_CODEGEN_CGRECORDLAYOUT_H
+
+namespace clang {
+namespace CodeGen {
+
+/// CGRecordLayout - This class handles struct and union layout info while
+/// lowering AST types to LLVM types.
+class CGRecordLayout {
+  CGRecordLayout(const CGRecordLayout&); // DO NOT IMPLEMENT
+  void operator=(const CGRecordLayout&); // DO NOT IMPLEMENT
+
+  /// The LLVMType corresponding to this record layout.
+  const llvm::Type *LLVMType;
+
+  /// Whether one of the fields in this record layout is a pointer to data
+  /// member, or a struct that contains pointer to data member.
+  bool ContainsPointerToDataMember;
+
+public:
+  CGRecordLayout(const llvm::Type *T, bool ContainsPointerToDataMember)
+    : LLVMType(T), ContainsPointerToDataMember(ContainsPointerToDataMember) {}
+
+  /// getLLVMType - Return llvm type associated with this record.
+  const llvm::Type *getLLVMType() const {
+    return LLVMType;
+  }
+
+  /// containsPointerToDataMember - Whether this struct contains pointers to
+  /// data members.
+  bool containsPointerToDataMember() const {
+    return ContainsPointerToDataMember;
+  }
+};
+
+}  // end namespace CodeGen
+}  // end namespace clang
+
+#endif
index baafd6836c6318442de31df638ef14147a184d19..4c77d2d2e0cc895562923e534e8f7c74cbfad3aa 100644 (file)
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CGRecordLayoutBuilder.h"
-
+#include "CGRecordLayout.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/DeclCXX.h"
index 4f37537769f9d84de495fb4e4a582fbac3081807..285d60a70f452c9c99b8fdd4c88c4dcd5d806fa8 100644 (file)
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CodeGenTypes.h"
+#include "CGRecordLayout.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclCXX.h"
index 9a620e4c0122ccf1ee9e4b2cb956492652e85613..c8bced32d3dcd6c2a1ca5724dad9f3f1d025c19f 100644 (file)
@@ -52,37 +52,9 @@ namespace clang {
   typedef CanQual<Type> CanQualType;
 
 namespace CodeGen {
+  class CGRecordLayout;
   class CodeGenTypes;
 
-  /// CGRecordLayout - This class handles struct and union layout info while
-  /// lowering AST types to LLVM types.
-  class CGRecordLayout {
-    CGRecordLayout(); // DO NOT IMPLEMENT
-
-    /// LLVMType - The LLVMType corresponding to this record layout.
-    const llvm::Type *LLVMType;
-
-    /// ContainsPointerToDataMember - Whether one of the fields in this record 
-    /// layout is a pointer to data member, or a struct that contains pointer to
-    /// data member.
-    bool ContainsPointerToDataMember;
-
-  public:
-    CGRecordLayout(const llvm::Type *T, bool ContainsPointerToDataMember)
-      : LLVMType(T), ContainsPointerToDataMember(ContainsPointerToDataMember) {}
-
-    /// getLLVMType - Return llvm type associated with this record.
-    const llvm::Type *getLLVMType() const {
-      return LLVMType;
-    }
-
-    /// containsPointerToDataMember - Whether this struct contains pointers to
-    /// data members.
-    bool containsPointerToDataMember() const {
-      return ContainsPointerToDataMember;
-    }
-  };
-
 /// CodeGenTypes - This class organizes the cross-module state that is used
 /// while lowering AST types to LLVM types.
 class CodeGenTypes {