LLVM API Documentation

ConstantFolding.h

Go to the documentation of this file.
00001 //===-- ConstantFolding.h - Analyze constant folding possibilities --------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This family of functions determines the possibility of performing constant
00011 // folding.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #include "llvm/Constants.h"
00016 #include "llvm/Function.h"
00017 using namespace llvm;
00018 
00019 namespace llvm {
00020 
00021 /// canConstantFoldCallTo - Return true if its even possible to fold a call to
00022 /// the specified function.
00023 extern
00024 bool canConstantFoldCallTo(Function *F);
00025 
00026 /// ConstantFoldFP - Given a function that evaluates the constant, return an
00027 ///                  LLVM Constant that represents the evaluated constant
00028 extern Constant *
00029 ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty);
00030 
00031 /// ConstantFoldCall - Attempt to constant fold a call to the specified function
00032 /// with the specified arguments, returning null if unsuccessful.
00033 extern Constant *
00034 ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands);
00035 }
00036