1 //===-- llvm/Assembly/Parser.h - Parser for VM assembly files ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // These classes are implemented by the lib/AsmParser library.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_ASSEMBLY_PARSER_H
15 #define LLVM_ASSEMBLY_PARSER_H
27 /// This function is the main interface to the LLVM Assembly Parser. It parses
28 /// an ASCII file that (presumably) contains LLVM Assembly code. It returns a
29 /// Module (intermediate representation) with the corresponding features. Note
30 /// that this does not verify that the generated Module is valid, so you should
31 /// run the verifier after parsing the file to check that it is okay.
32 /// @brief Parse LLVM Assembly from a file
33 Module *ParseAssemblyFile(
34 const std::string &Filename, ///< The name of the file to parse
35 SMDiagnostic &Error, ///< Error result info.
36 LLVMContext &Context ///< Context in which to allocate globals info.
39 /// The function is a secondary interface to the LLVM Assembly Parser. It parses
40 /// an ASCII string that (presumably) contains LLVM Assembly code. It returns a
41 /// Module (intermediate representation) with the corresponding features. Note
42 /// that this does not verify that the generated Module is valid, so you should
43 /// run the verifier after parsing the file to check that it is okay.
44 /// @brief Parse LLVM Assembly from a string
45 Module *ParseAssemblyString(
46 const char *AsmString, ///< The string containing assembly
47 Module *M, ///< A module to add the assembly too.
48 SMDiagnostic &Error, ///< Error result info.
52 /// This function is the low-level interface to the LLVM Assembly Parser.
53 /// ParseAssemblyFile and ParseAssemblyString are wrappers around this function.
54 /// @brief Parse LLVM Assembly from a MemoryBuffer.
55 Module *ParseAssembly(
56 MemoryBuffer *F, ///< The MemoryBuffer containing assembly
57 const std::string &Name, ///< The name of the original source file
58 Module *M, ///< A module to add the assembly too.
59 SMDiagnostic &Err, ///< Error result info.
63 } // End llvm namespace