[llvm-commits] CVS: llvm/include/llvm/Analysis/ConstantFolding.h

John Criswell criswell at cs.uiuc.edu
Thu Oct 27 09:00:31 PDT 2005



Changes in directory llvm/include/llvm/Analysis:

ConstantFolding.h added (r1.1)
---
Log message:

Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.


---
Diffs of the changes:  (+36 -0)

 ConstantFolding.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+)


Index: llvm/include/llvm/Analysis/ConstantFolding.h
diff -c /dev/null llvm/include/llvm/Analysis/ConstantFolding.h:1.1
*** /dev/null	Thu Oct 27 11:00:19 2005
--- llvm/include/llvm/Analysis/ConstantFolding.h	Thu Oct 27 11:00:09 2005
***************
*** 0 ****
--- 1,36 ----
+ //===-- ConstantFolding.h - Analyze constant folding possibilities --------===//
+ //
+ //                     The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the LLVM research group and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ //===----------------------------------------------------------------------===//
+ //
+ // This family of functions determines the possibility of performing constant
+ // folding.
+ //
+ //===----------------------------------------------------------------------===//
+ 
+ #include "llvm/Constants.h"
+ #include "llvm/Function.h"
+ using namespace llvm;
+ 
+ namespace llvm {
+ 
+ /// canConstantFoldCallTo - Return true if its even possible to fold a call to
+ /// the specified function.
+ extern
+ bool canConstantFoldCallTo(Function *F);
+ 
+ /// ConstantFoldFP - Given a function that evaluates the constant, return an
+ ///                  LLVM Constant that represents the evaluated constant
+ extern Constant *
+ ConstantFoldFP(double (*NativeFP)(double), double V, const Type *Ty);
+ 
+ /// ConstantFoldCall - Attempt to constant fold a call to the specified function
+ /// with the specified arguments, returning null if unsuccessful.
+ extern Constant *
+ ConstantFoldCall(Function *F, const std::vector<Constant*> &Operands);
+ }
+ 






More information about the llvm-commits mailing list