The best unbreakage yet, addressing Bill's concerns.
[oota-llvm.git] / include / llvm / CodeGen / IntrinsicLowering.h
1 //===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source 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
16 #ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
17 #define LLVM_CODEGEN_INTRINSICLOWERING_H
18
19 #include "llvm/Intrinsics.h"
20
21 namespace llvm {
22   class CallInst;
23   class Module;
24
25   class IntrinsicLowering {
26   public:
27     IntrinsicLowering() {}
28
29     /// AddPrototypes - This method, if called, causes all of the prototypes
30     /// that might be needed by an intrinsic lowering implementation to be
31     /// inserted into the module specified.
32     void AddPrototypes(Module &M);
33
34     /// LowerIntrinsicCall - This method returns the LLVM function which should
35     /// be used to implement the specified intrinsic function call.  If an
36     /// intrinsic function must be implemented by the code generator (such as
37     /// va_start), this function should print a message and abort.
38     ///
39     /// Otherwise, if an intrinsic function call can be lowered, the code to
40     /// implement it (often a call to a non-intrinsic function) is inserted
41     /// _after_ the call instruction and the call is deleted.  The caller must
42     /// be capable of handling this kind of change.
43     ///
44     void LowerIntrinsicCall(CallInst *CI);
45   };
46 }
47
48 #endif