summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/CodeGen/ModuleBuilder.cpp')
-rw-r--r--clang/CodeGen/ModuleBuilder.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/clang/CodeGen/ModuleBuilder.cpp b/clang/CodeGen/ModuleBuilder.cpp
new file mode 100644
index 00000000000..309a35762a2
--- /dev/null
+++ b/clang/CodeGen/ModuleBuilder.cpp
@@ -0,0 +1,40 @@
+//===--- ModuleBuilder.cpp - Emit LLVM Code from ASTs ---------------------===//
+//
+// 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 builds an AST and converts it to LLVM Code.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CodeGen/ModuleBuilder.h"
+#include "Builder.h"
+using namespace llvm;
+using namespace clang;
+
+
+/// 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);
+}
+
+void llvm::clang::CodeGen::Terminate(BuilderTy *B) {
+ delete static_cast<Builder*>(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);
+}
+
+/// PrintStats - Emit statistic information to stderr.
+///
+void llvm::clang::CodeGen::PrintStats(BuilderTy *B) {
+ static_cast<Builder*>(B)->PrintStats();
+}
OpenPOWER on IntegriCloud