1 //===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
17 #define LLVM_CODEGEN_INTRINSICLOWERING_H
19 #include "llvm/Intrinsics.h"
26 class IntrinsicLowering {
29 explicit IntrinsicLowering(const TargetData &td) : TD(td) {}
31 /// AddPrototypes - This method, if called, causes all of the prototypes
32 /// that might be needed by an intrinsic lowering implementation to be
33 /// inserted into the module specified.
34 void AddPrototypes(Module &M);
36 /// LowerIntrinsicCall - This method replaces a call with the LLVM function
37 /// which should be used to implement the specified intrinsic function call.
38 /// If an intrinsic function must be implemented by the code generator
39 /// (such as va_start), this function should print a message and abort.
41 /// Otherwise, if an intrinsic function call can be lowered, the code to
42 /// implement it (often a call to a non-intrinsic function) is inserted
43 /// _after_ the call instruction and the call is deleted. The caller must
44 /// be capable of handling this kind of change.
46 void LowerIntrinsicCall(CallInst *CI);