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.

65 lines
2.3 KiB

  1. //===-- llvm/Target/TargetIntrinsicInfo.h - Instruction Info ----*- 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 describes the target intrinsic instructions to the code generator.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_TARGET_TARGETINTRINSICINFO_H
  14. #define LLVM_TARGET_TARGETINTRINSICINFO_H
  15. #include "llvm/Support/Compiler.h"
  16. #include <string>
  17. namespace llvm {
  18. class Function;
  19. class Module;
  20. class Type;
  21. //---------------------------------------------------------------------------
  22. ///
  23. /// TargetIntrinsicInfo - Interface to description of machine instruction set
  24. ///
  25. class TargetIntrinsicInfo {
  26. TargetIntrinsicInfo(const TargetIntrinsicInfo &) LLVM_DELETED_FUNCTION;
  27. void operator=(const TargetIntrinsicInfo &) LLVM_DELETED_FUNCTION;
  28. public:
  29. TargetIntrinsicInfo();
  30. virtual ~TargetIntrinsicInfo();
  31. /// Return the name of a target intrinsic, e.g. "llvm.bfin.ssync".
  32. /// The Tys and numTys parameters are for intrinsics with overloaded types
  33. /// (e.g., those using iAny or fAny). For a declaration for an overloaded
  34. /// intrinsic, Tys should point to an array of numTys pointers to Type,
  35. /// and must provide exactly one type for each overloaded type in the
  36. /// intrinsic.
  37. virtual std::string getName(unsigned IID, Type **Tys = 0,
  38. unsigned numTys = 0) const = 0;
  39. /// Look up target intrinsic by name. Return intrinsic ID or 0 for unknown
  40. /// names.
  41. virtual unsigned lookupName(const char *Name, unsigned Len) const =0;
  42. /// Return the target intrinsic ID of a function, or 0.
  43. virtual unsigned getIntrinsicID(Function *F) const;
  44. /// Returns true if the intrinsic can be overloaded.
  45. virtual bool isOverloaded(unsigned IID) const = 0;
  46. /// Create or insert an LLVM Function declaration for an intrinsic,
  47. /// and return it. The Tys and numTys are for intrinsics with overloaded
  48. /// types. See above for more information.
  49. virtual Function *getDeclaration(Module *M, unsigned ID, Type **Tys = 0,
  50. unsigned numTys = 0) const = 0;
  51. };
  52. } // End llvm namespace
  53. #endif