//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the ModuleBuilder interface.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H
#define LLVM_CLANG_CODEGEN_MODULEBUILDER_H

#include "clang/AST/ASTConsumer.h"
#include <string>

namespace llvm {
  class LLVMContext;
  class Module;
}

namespace clang {
  class Diagnostic;
  class LangOptions;
  class CodeGenOptions;

  class CodeGenerator : public ASTConsumer {
  public:
    virtual llvm::Module* GetModule() = 0;
    virtual llvm::Module* ReleaseModule() = 0;
  };

  CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
                                   const std::string &ModuleName,
                                   const CodeGenOptions &CGO,
                                   llvm::LLVMContext& C);
}

#endif

//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the ModuleBuilder interface.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H
#define LLVM_CLANG_CODEGEN_MODULEBUILDER_H

#include "clang/AST/ASTConsumer.h"
#include <string>

namespace llvm {
  class LLVMContext;
  class Module;
}

namespace clang {
  class Diagnostic;
  class LangOptions;
  class CodeGenOptions;

  class CodeGenerator : public ASTConsumer {
  public:
    virtual llvm::Module* GetModule() = 0;
    virtual llvm::Module* ReleaseModule() = 0;
  };

  /// CreateLLVMCodeGen - Create a CodeGenerator instance.
  /// It is the responsibility of the caller to call delete on
  /// the allocated CodeGenerator instance.
  CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
                                   const std::string &ModuleName,
                                   const CodeGenOptions &CGO,
                                   llvm::LLVMContext& C);
}

#endif

Add a comment to mention the memory ownership situation.
Add a comment to mention the memory ownership situation.


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@104886 91177308-0d34-0410-b5e6-96231b3b80d8
