aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFolding.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-26 16:48:56 +0000
committerChris Lattner <sabre@nondot.org>2001-11-26 16:48:56 +0000
commit89279732832f587136f66004d76eb08153d0df98 (patch)
treee2c854426d83fe082350563bcfe1dfa2e75edb13 /lib/VMCore/ConstantFolding.h
parent45ee091719fb519457d2e96599596011a0b5e449 (diff)
downloadexternal_llvm-89279732832f587136f66004d76eb08153d0df98.zip
external_llvm-89279732832f587136f66004d76eb08153d0df98.tar.gz
external_llvm-89279732832f587136f66004d76eb08153d0df98.tar.bz2
Be more const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFolding.h')
-rw-r--r--lib/VMCore/ConstantFolding.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/ConstantFolding.h b/lib/VMCore/ConstantFolding.h
index 9e9e760..72632ee 100644
--- a/lib/VMCore/ConstantFolding.h
+++ b/lib/VMCore/ConstantFolding.h
@@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
// Implement higher level instruction folding type instructions
//===----------------------------------------------------------------------===//
-inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V,
+inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V,
const Type *DestTy) {
return ConstRules::get(*V)->castTo(V, DestTy);
}
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
- ConstPoolVal *V) {
+ const ConstPoolVal *V) {
switch (Opcode) {
case Instruction::Not: return !*V;
// TODO: Handle get element ptr instruction here in the future? GEP null?
@@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
}
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
- ConstPoolVal *V1,
- ConstPoolVal *V2) {
+ const ConstPoolVal *V1,
+ const ConstPoolVal *V2) {
switch (Opcode) {
case Instruction::Add: return *V1 + *V2;
case Instruction::Sub: return *V1 - *V2;