[cfe-commits] r99945 - in /cfe/trunk/lib/CodeGen: CGExprConstant.cpp CGRecordLayout.h CGRecordLayoutBuilder.cpp CodeGenTypes.cpp CodeGenTypes.h
Daniel Dunbar
daniel at zuster.org
Tue Mar 30 15:26:10 PDT 2010
Author: ddunbar
Date: Tue Mar 30 17:26:10 2010
New Revision: 99945
URL: http://llvm.org/viewvc/llvm-project?rev=99945&view=rev
Log:
IRgen: Move CGRecordLayout to its own happy little file.
Added:
cfe/trunk/lib/CodeGen/CGRecordLayout.h
Modified:
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
cfe/trunk/lib/CodeGen/CodeGenTypes.h
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=99945&r1=99944&r2=99945&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Tue Mar 30 17:26:10 2010
@@ -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"
Added: cfe/trunk/lib/CodeGen/CGRecordLayout.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayout.h?rev=99945&view=auto
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayout.h (added)
+++ cfe/trunk/lib/CodeGen/CGRecordLayout.h Tue Mar 30 17:26:10 2010
@@ -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
Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp?rev=99945&r1=99944&r2=99945&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp Tue Mar 30 17:26:10 2010
@@ -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"
Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=99945&r1=99944&r2=99945&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Tue Mar 30 17:26:10 2010
@@ -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"
Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.h?rev=99945&r1=99944&r2=99945&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.h Tue Mar 30 17:26:10 2010
@@ -52,37 +52,9 @@
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 {
More information about the cfe-commits
mailing list