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.

59 lines
2.1 KiB

  1. //===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- 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 the IntrinsicLowering interface. This interface allows
  11. // addition of domain-specific or front-end specific intrinsics to LLVM without
  12. // having to modify all of the C backend or interpreter.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
  16. #define LLVM_CODEGEN_INTRINSICLOWERING_H
  17. #include "llvm/IR/Intrinsics.h"
  18. namespace llvm {
  19. class CallInst;
  20. class Module;
  21. class DataLayout;
  22. class IntrinsicLowering {
  23. const DataLayout& TD;
  24. bool Warned;
  25. public:
  26. explicit IntrinsicLowering(const DataLayout &td) :
  27. TD(td), Warned(false) {}
  28. /// AddPrototypes - This method, if called, causes all of the prototypes
  29. /// that might be needed by an intrinsic lowering implementation to be
  30. /// inserted into the module specified.
  31. void AddPrototypes(Module &M);
  32. /// LowerIntrinsicCall - This method replaces a call with the LLVM function
  33. /// which should be used to implement the specified intrinsic function call.
  34. /// If an intrinsic function must be implemented by the code generator
  35. /// (such as va_start), this function should print a message and abort.
  36. ///
  37. /// Otherwise, if an intrinsic function call can be lowered, the code to
  38. /// implement it (often a call to a non-intrinsic function) is inserted
  39. /// _after_ the call instruction and the call is deleted. The caller must
  40. /// be capable of handling this kind of change.
  41. ///
  42. void LowerIntrinsicCall(CallInst *CI);
  43. /// LowerToByteSwap - Replace a call instruction into a call to bswap
  44. /// intrinsic. Return false if it has determined the call is not a
  45. /// simple integer bswap.
  46. static bool LowerToByteSwap(CallInst *CI);
  47. };
  48. }
  49. #endif