[cfe-commits] r39504 - in /cfe/cfe/trunk: CodeGen/Builder.h CodeGen/CodeGenFunction.cpp CodeGen/CodeGenFunction.h CodeGen/CodeGenModule.cpp CodeGen/CodeGenModule.h CodeGen/ModuleBuilder.cpp clang.xcodeproj/project.pbxproj

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:45:04 PDT 2007


Author: clattner
Date: Wed Jul 11 11:45:03 2007
New Revision: 39504

URL: http://llvm.org/viewvc/llvm-project?rev=39504&view=rev
Log:
Reorganize codegen files.

Added:
    cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp   (with props)
    cfe/cfe/trunk/CodeGen/CodeGenFunction.h   (with props)
    cfe/cfe/trunk/CodeGen/CodeGenModule.cpp   (with props)
    cfe/cfe/trunk/CodeGen/CodeGenModule.h   (with props)
Removed:
    cfe/cfe/trunk/CodeGen/Builder.h
Modified:
    cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp
    cfe/cfe/trunk/clang.xcodeproj/project.pbxproj

Removed: cfe/cfe/trunk/CodeGen/Builder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/Builder.h?rev=39503&view=auto

==============================================================================
--- cfe/cfe/trunk/CodeGen/Builder.h (original)
+++ cfe/cfe/trunk/CodeGen/Builder.h (removed)
@@ -1,40 +0,0 @@
-//===--- Builder.h - Internal interface for LLVM Builder ------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file was developed by Chris Lattner and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is the internal per-translation-unit state used for llvm translation. 
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef CODEGEN_BUILDER_H
-#define CODEGEN_BUILDER_H
-
-namespace llvm {
-  class Module;
-namespace clang {
-  class ASTContext;
-  class FunctionDecl;
-    
-namespace CodeGen {
-
-class Builder {
-  ASTContext &Context;
-  Module &TheModule;
-public:
-  Builder(ASTContext &C, Module &M) : Context(C), TheModule(M) {}
-  
-  void CodeGenFunction(FunctionDecl *FD) {}
-  
-  void PrintStats() {}
-    
-};
-}  // end namespace CodeGen
-}  // end namespace clang
-}  // end namespace llvm
-
-#endif

Added: cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp?rev=39504&view=auto

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp (added)
+++ cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp Wed Jul 11 11:45:03 2007
@@ -0,0 +1,20 @@
+//===--- CodeGenFunction.cpp - Emit LLVM Code from ASTs for a Function ----===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This coordinates the per-function state used while generating code.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CodeGenFunction.h"
+#include "CodeGenModule.h"
+#include "llvm/Support/LLVMBuilder.h"
+using namespace llvm;
+using namespace clang;
+using namespace CodeGen;
+

Propchange: cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/CodeGen/CodeGenFunction.cpp

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: cfe/cfe/trunk/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenFunction.h?rev=39504&view=auto

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenFunction.h (added)
+++ cfe/cfe/trunk/CodeGen/CodeGenFunction.h Wed Jul 11 11:45:03 2007
@@ -0,0 +1,38 @@
+//===--- CodeGenFunction.h - Per-Function state for LLVM CodeGen ----------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the internal per-function state used for llvm translation. 
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CODEGEN_CODEGENFUNCTION_H
+#define CODEGEN_CODEGENFUNCTION_H
+
+namespace llvm {
+  class Module;
+namespace clang {
+  class ASTContext;
+  class FunctionDecl;
+  
+namespace CodeGen {
+  class CodeGenModule;
+  
+/// CodeGenFunction - This class organizes the per-function state that is used
+/// while generating LLVM code.
+class CodeGenFunction {
+  CodeGenModule &CGM;  // Per-module state.
+public:
+  CodeGenFunction(CodeGenModule &cgm) : CGM(cgm) {}
+  
+};
+}  // end namespace CodeGen
+}  // end namespace clang
+}  // end namespace llvm
+
+#endif

Propchange: cfe/cfe/trunk/CodeGen/CodeGenFunction.h

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/CodeGen/CodeGenFunction.h

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: cfe/cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=39504&view=auto

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenModule.cpp (added)
+++ cfe/cfe/trunk/CodeGen/CodeGenModule.cpp Wed Jul 11 11:45:03 2007
@@ -0,0 +1,24 @@
+//===--- CodeGenModule.cpp - Emit LLVM Code from ASTs for a Module --------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This coordinates the per-module state used while generating code.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CodeGenModule.h"
+#include "CodeGenFunction.h"
+using namespace llvm;
+using namespace clang;
+using namespace CodeGen;
+
+
+void CodeGenModule::EmitFunction(FunctionDecl *FD) {
+  CodeGenFunction CGF(*this);
+  
+}

Propchange: cfe/cfe/trunk/CodeGen/CodeGenModule.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/CodeGen/CodeGenModule.cpp

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: cfe/cfe/trunk/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/CodeGenModule.h?rev=39504&view=auto

==============================================================================
--- cfe/cfe/trunk/CodeGen/CodeGenModule.h (added)
+++ cfe/cfe/trunk/CodeGen/CodeGenModule.h Wed Jul 11 11:45:03 2007
@@ -0,0 +1,41 @@
+//===--- CodeGenModule.h - Per-Module state for LLVM CodeGen --------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the internal per-translation-unit state used for llvm translation. 
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CODEGEN_CODEGENMODULE_H
+#define CODEGEN_CODEGENMODULE_H
+
+namespace llvm {
+  class Module;
+namespace clang {
+  class ASTContext;
+  class FunctionDecl;
+    
+namespace CodeGen {
+
+/// CodeGenModule - This class organizes the cross-module state that is used
+/// while generating LLVM code.
+class CodeGenModule {
+  ASTContext &Context;
+  Module &TheModule;
+public:
+  CodeGenModule(ASTContext &C, Module &M) : Context(C), TheModule(M) {}
+  
+  void EmitFunction(FunctionDecl *FD);
+  
+  void PrintStats() {}
+};
+}  // end namespace CodeGen
+}  // end namespace clang
+}  // end namespace llvm
+
+#endif

Propchange: cfe/cfe/trunk/CodeGen/CodeGenModule.h

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/CodeGen/CodeGenModule.h

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp?rev=39504&r1=39503&r2=39504&view=diff

==============================================================================
--- cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp (original)
+++ cfe/cfe/trunk/CodeGen/ModuleBuilder.cpp Wed Jul 11 11:45:03 2007
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/CodeGen/ModuleBuilder.h"
-#include "Builder.h"
+#include "CodeGenModule.h"
 using namespace llvm;
 using namespace clang;
 
@@ -20,21 +20,21 @@
 /// Init - Create an ModuleBuilder with the specified ASTContext.
 llvm::clang::CodeGen::BuilderTy *
 llvm::clang::CodeGen::Init(ASTContext &Context, Module &M) {
-  return new Builder(Context, M);
+  return new CodeGenModule(Context, M);
 }
 
 void llvm::clang::CodeGen::Terminate(BuilderTy *B) {
-  delete static_cast<Builder*>(B);
+  delete static_cast<CodeGenModule*>(B);
 }
 
 /// CodeGenFunction - Convert the AST node for a FunctionDecl into LLVM.
 ///
 void llvm::clang::CodeGen::CodeGenFunction(BuilderTy *B, FunctionDecl *D) {
-  static_cast<Builder*>(B)->CodeGenFunction(D);
+  static_cast<CodeGenModule*>(B)->EmitFunction(D);
 }
 
 /// PrintStats - Emit statistic information to stderr.
 ///
 void llvm::clang::CodeGen::PrintStats(BuilderTy *B) {
-  static_cast<Builder*>(B)->PrintStats();
+  static_cast<CodeGenModule*>(B)->PrintStats();
 }

Modified: cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=39504&r1=39503&r2=39504&view=diff

==============================================================================
--- cfe/cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/cfe/trunk/clang.xcodeproj/project.pbxproj Wed Jul 11 11:45:03 2007
@@ -56,9 +56,12 @@
 		DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE75ED280B044DC90020CF81 /* ASTContext.h */; };
 		DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75EDF00B06880E0020CF81 /* Type.cpp */; };
 		DE927FFD0C055DE900231DA4 /* LLVMCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE927FFC0C055DE900231DA4 /* LLVMCodegen.cpp */; };
-		DE928B110C05658A00231DA4 /* Builder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B100C05658A00231DA4 /* Builder.h */; };
 		DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B120C05659200231DA4 /* ModuleBuilder.cpp */; };
 		DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */; };
+		DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B7C0C0A615100231DA4 /* CodeGenModule.h */; };
+		DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */; };
+		DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B800C0A615B00231DA4 /* CodeGenFunction.h */; };
+		DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */; };
 		DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */; };
 		DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEED4A0A5AF89A0045101B /* NOTES.txt */; };
 		DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9900A9433CD00353FCA /* Decl.h */; };
@@ -100,23 +103,6 @@
 		DED7D9E50A5257F6003AD0FB /* ScratchBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-		84FCE23B0C08F6EF00F0C622 /* Development */ = {
-			isa = PBXBuildStyle;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-			};
-			name = Development;
-		};
-		84FCE23C0C08F6EF00F0C622 /* Deployment */ = {
-			isa = PBXBuildStyle;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-			};
-			name = Deployment;
-		};
-/* End PBXBuildStyle section */
-
 /* Begin PBXCopyFilesBuildPhase section */
 		8DD76F690486A84900D96B5E /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
@@ -168,8 +154,9 @@
 				1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */,
 				DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */,
 				DE67E7280C02109800F66BC5 /* ASTStreamer.h in CopyFiles */,
-				DE928B110C05658A00231DA4 /* Builder.h in CopyFiles */,
 				DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */,
+				DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */,
+				DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 		};
@@ -226,9 +213,12 @@
 		DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = "<group>"; };
 		DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = AST/Type.cpp; sourceTree = "<group>"; };
 		DE927FFC0C055DE900231DA4 /* LLVMCodegen.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = LLVMCodegen.cpp; path = Driver/LLVMCodegen.cpp; sourceTree = "<group>"; };
-		DE928B100C05658A00231DA4 /* Builder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Builder.h; path = CodeGen/Builder.h; sourceTree = "<group>"; };
 		DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = CodeGen/ModuleBuilder.cpp; sourceTree = "<group>"; };
 		DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ModuleBuilder.h; path = clang/CodeGen/ModuleBuilder.h; sourceTree = "<group>"; };
+		DE928B7C0C0A615100231DA4 /* CodeGenModule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CodeGenModule.h; path = CodeGen/CodeGenModule.h; sourceTree = "<group>"; };
+		DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenModule.cpp; path = CodeGen/CodeGenModule.cpp; sourceTree = "<group>"; };
+		DE928B800C0A615B00231DA4 /* CodeGenFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CodeGenFunction.h; path = CodeGen/CodeGenFunction.h; sourceTree = "<group>"; };
+		DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenFunction.cpp; path = CodeGen/CodeGenFunction.cpp; sourceTree = "<group>"; };
 		DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = "<group>"; };
 		DEAEED4A0A5AF89A0045101B /* NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NOTES.txt; sourceTree = "<group>"; };
 		DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = "<group>"; };
@@ -376,7 +366,10 @@
 		DE927FCC0C0557CD00231DA4 /* CodeGen */ = {
 			isa = PBXGroup;
 			children = (
-				DE928B100C05658A00231DA4 /* Builder.h */,
+				DE928B800C0A615B00231DA4 /* CodeGenFunction.h */,
+				DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */,
+				DE928B7C0C0A615100231DA4 /* CodeGenModule.h */,
+				DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */,
 				DE928B120C05659200231DA4 /* ModuleBuilder.cpp */,
 			);
 			name = CodeGen;
@@ -545,12 +538,6 @@
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-			buildSettings = {
-			};
-			buildStyles = (
-				84FCE23B0C08F6EF00F0C622 /* Development */,
-				84FCE23C0C08F6EF00F0C622 /* Deployment */,
-			);
 			hasScannedForEncodings = 1;
 			mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
 			projectDirPath = "";
@@ -610,6 +597,8 @@
 				DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */,
 				DE927FFD0C055DE900231DA4 /* LLVMCodegen.cpp in Sources */,
 				DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */,
+				DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */,
+				DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};





More information about the cfe-commits mailing list