Deleted Added
sdiff udiff text old ( 193326 ) new ( 195341 )
full compact
1//===--- ModuleBuilder.cpp - Emit LLVM Code from ASTs ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 5 unchanged lines hidden (view full) ---

14#include "clang/CodeGen/ModuleBuilder.h"
15#include "CodeGenModule.h"
16#include "clang/Frontend/CompileOptions.h"
17#include "clang/AST/ASTContext.h"
18#include "clang/AST/DeclObjC.h"
19#include "clang/AST/Expr.h"
20#include "clang/Basic/Diagnostic.h"
21#include "clang/Basic/TargetInfo.h"
22#include "llvm/Module.h"
23#include "llvm/Target/TargetData.h"
24#include "llvm/Support/Compiler.h"
25#include "llvm/ADT/OwningPtr.h"
26using namespace clang;
27
28
29namespace {
30 class VISIBILITY_HIDDEN CodeGeneratorImpl : public CodeGenerator {
31 Diagnostic &Diags;
32 llvm::OwningPtr<const llvm::TargetData> TD;
33 ASTContext *Ctx;
34 const CompileOptions CompileOpts; // Intentionally copied in.
35 protected:
36 llvm::OwningPtr<llvm::Module> M;
37 llvm::OwningPtr<CodeGen::CodeGenModule> Builder;
38 public:
39 CodeGeneratorImpl(Diagnostic &diags, const std::string& ModuleName,
40 const CompileOptions &CO)
41 : Diags(diags), CompileOpts(CO), M(new llvm::Module(ModuleName)) {}
42
43 virtual ~CodeGeneratorImpl() {}
44
45 virtual llvm::Module* GetModule() {
46 return M.get();
47 }
48
49 virtual llvm::Module* ReleaseModule() {

--- 40 unchanged lines hidden (view full) ---

90
91 Builder->EmitTentativeDefinition(D);
92 }
93 };
94}
95
96CodeGenerator *clang::CreateLLVMCodeGen(Diagnostic &Diags,
97 const std::string& ModuleName,
98 const CompileOptions &CO) {
99 return new CodeGeneratorImpl(Diags, ModuleName, CO);
100}