]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/include/llvm/IRReader/IRReader.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / include / llvm / IRReader / IRReader.h
1 //===---- llvm/IRReader/IRReader.h - Reader for LLVM IR files ---*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
9 //
10 // This file defines functions for reading LLVM IR. They support both
11 // Bitcode and Assembly, automatically detecting the input format.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_IRREADER_IRREADER_H
16 #define LLVM_IRREADER_IRREADER_H
17
18 #include <string>
19
20 namespace llvm {
21
22 class Module;
23 class MemoryBuffer;
24 class SMDiagnostic;
25 class LLVMContext;
26
27 /// If the given MemoryBuffer holds a bitcode image, return a Module for it
28 /// which does lazy deserialization of function bodies.  Otherwise, attempt to
29 /// parse it as LLVM Assembly and return a fully populated Module. This
30 /// function *always* takes ownership of the given MemoryBuffer.
31 Module *getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err,
32                         LLVMContext &Context);
33
34 /// If the given file holds a bitcode image, return a Module
35 /// for it which does lazy deserialization of function bodies.  Otherwise,
36 /// attempt to parse it as LLVM Assembly and return a fully populated
37 /// Module.
38 Module *getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err,
39                             LLVMContext &Context);
40
41 /// If the given MemoryBuffer holds a bitcode image, return a Module
42 /// for it.  Otherwise, attempt to parse it as LLVM Assembly and return
43 /// a Module for it. This function *always* takes ownership of the given
44 /// MemoryBuffer.
45 Module *ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, LLVMContext &Context);
46
47 /// If the given file holds a bitcode image, return a Module for it.
48 /// Otherwise, attempt to parse it as LLVM Assembly and return a Module
49 /// for it.
50 Module *ParseIRFile(const std::string &Filename, SMDiagnostic &Err,
51                     LLVMContext &Context);
52
53 }
54
55 #endif