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.

55 lines
2.0 KiB

  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. #ifndef LLVM_IRREADER_IRREADER_H
  15. #define LLVM_IRREADER_IRREADER_H
  16. #include <string>
  17. namespace llvm {
  18. class Module;
  19. class MemoryBuffer;
  20. class SMDiagnostic;
  21. class LLVMContext;
  22. /// If the given MemoryBuffer holds a bitcode image, return a Module for it
  23. /// which does lazy deserialization of function bodies. Otherwise, attempt to
  24. /// parse it as LLVM Assembly and return a fully populated Module. This
  25. /// function *always* takes ownership of the given MemoryBuffer.
  26. Module *getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err,
  27. LLVMContext &Context);
  28. /// If the given file holds a bitcode image, return a Module
  29. /// for it which does lazy deserialization of function bodies. Otherwise,
  30. /// attempt to parse it as LLVM Assembly and return a fully populated
  31. /// Module.
  32. Module *getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err,
  33. LLVMContext &Context);
  34. /// If the given MemoryBuffer holds a bitcode image, return a Module
  35. /// for it. Otherwise, attempt to parse it as LLVM Assembly and return
  36. /// a Module for it. This function *always* takes ownership of the given
  37. /// MemoryBuffer.
  38. Module *ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, LLVMContext &Context);
  39. /// If the given file holds a bitcode image, return a Module for it.
  40. /// Otherwise, attempt to parse it as LLVM Assembly and return a Module
  41. /// for it.
  42. Module *ParseIRFile(const std::string &Filename, SMDiagnostic &Err,
  43. LLVMContext &Context);
  44. }
  45. #endif