Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.5 KiB

  1. //===-- llvm/Assembly/Parser.h - Parser for VM assembly 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. // These classes are implemented by the lib/AsmParser library.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_ASSEMBLY_PARSER_H
  14. #define LLVM_ASSEMBLY_PARSER_H
  15. #include <string>
  16. namespace llvm {
  17. class Module;
  18. class MemoryBuffer;
  19. class SMDiagnostic;
  20. class LLVMContext;
  21. /// This function is the main interface to the LLVM Assembly Parser. It parses
  22. /// an ASCII file that (presumably) contains LLVM Assembly code. It returns a
  23. /// Module (intermediate representation) with the corresponding features. Note
  24. /// that this does not verify that the generated Module is valid, so you should
  25. /// run the verifier after parsing the file to check that it is okay.
  26. /// @brief Parse LLVM Assembly from a file
  27. Module *ParseAssemblyFile(
  28. const std::string &Filename, ///< The name of the file to parse
  29. SMDiagnostic &Error, ///< Error result info.
  30. LLVMContext &Context ///< Context in which to allocate globals info.
  31. );
  32. /// The function is a secondary interface to the LLVM Assembly Parser. It parses
  33. /// an ASCII string that (presumably) contains LLVM Assembly code. It returns a
  34. /// Module (intermediate representation) with the corresponding features. Note
  35. /// that this does not verify that the generated Module is valid, so you should
  36. /// run the verifier after parsing the file to check that it is okay.
  37. /// @brief Parse LLVM Assembly from a string
  38. Module *ParseAssemblyString(
  39. const char *AsmString, ///< The string containing assembly
  40. Module *M, ///< A module to add the assembly too.
  41. SMDiagnostic &Error, ///< Error result info.
  42. LLVMContext &Context
  43. );
  44. /// This function is the low-level interface to the LLVM Assembly Parser.
  45. /// ParseAssemblyFile and ParseAssemblyString are wrappers around this function.
  46. /// @brief Parse LLVM Assembly from a MemoryBuffer. This function *always*
  47. /// takes ownership of the MemoryBuffer.
  48. Module *ParseAssembly(
  49. MemoryBuffer *F, ///< The MemoryBuffer containing assembly
  50. Module *M, ///< A module to add the assembly too.
  51. SMDiagnostic &Err, ///< Error result info.
  52. LLVMContext &Context
  53. );
  54. } // End llvm namespace
  55. #endif