blob: 309a35762a234f6b33def03e1653579b75ccb4b6 [file] [log] [blame]
Chris Lattnerf97fe382007-05-24 06:29:05 +00001//===--- ModuleBuilder.cpp - Emit LLVM Code from ASTs ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This builds an AST and converts it to LLVM Code.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/CodeGen/ModuleBuilder.h"
15#include "Builder.h"
16using namespace llvm;
17using namespace clang;
18
19
20/// Init - Create an ModuleBuilder with the specified ASTContext.
21llvm::clang::CodeGen::BuilderTy *
22llvm::clang::CodeGen::Init(ASTContext &Context, Module &M) {
23 return new Builder(Context, M);
24}
25
26void llvm::clang::CodeGen::Terminate(BuilderTy *B) {
27 delete static_cast<Builder*>(B);
28}
29
30/// CodeGenFunction - Convert the AST node for a FunctionDecl into LLVM.
31///
32void llvm::clang::CodeGen::CodeGenFunction(BuilderTy *B, FunctionDecl *D) {
33 static_cast<Builder*>(B)->CodeGenFunction(D);
34}
35
36/// PrintStats - Emit statistic information to stderr.
37///
38void llvm::clang::CodeGen::PrintStats(BuilderTy *B) {
39 static_cast<Builder*>(B)->PrintStats();
40}