LLVM API Documentation
00001 //===-- llvm/Assembly/Parser.h - Parser for VM assembly files ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // These classes are implemented by the lib/AsmParser library. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_ASSEMBLY_PARSER_H 00015 #define LLVM_ASSEMBLY_PARSER_H 00016 00017 #include <string> 00018 00019 namespace llvm { 00020 00021 class Module; 00022 class SMDiagnostic; 00023 class raw_ostream; 00024 class LLVMContext; 00025 00026 /// This function is the main interface to the LLVM Assembly Parser. It parses 00027 /// an ASCII file that (presumably) contains LLVM Assembly code. It returns a 00028 /// Module (intermediate representation) with the corresponding features. Note 00029 /// that this does not verify that the generated Module is valid, so you should 00030 /// run the verifier after parsing the file to check that it is okay. 00031 /// @brief Parse LLVM Assembly from a file 00032 Module *ParseAssemblyFile( 00033 const std::string &Filename, ///< The name of the file to parse 00034 SMDiagnostic &Error, ///< Error result info. 00035 LLVMContext &Context ///< Context in which to allocate globals info. 00036 ); 00037 00038 /// The function is a secondary interface to the LLVM Assembly Parser. It parses 00039 /// an ASCII string that (presumably) contains LLVM Assembly code. It returns a 00040 /// Module (intermediate representation) with the corresponding features. Note 00041 /// that this does not verify that the generated Module is valid, so you should 00042 /// run the verifier after parsing the file to check that it is okay. 00043 /// @brief Parse LLVM Assembly from a string 00044 Module *ParseAssemblyString( 00045 const char *AsmString, ///< The string containing assembly 00046 Module *M, ///< A module to add the assembly too. 00047 SMDiagnostic &Error, ///< Error result info. 00048 LLVMContext &Context 00049 ); 00050 00051 } // End llvm namespace 00052 00053 #endif