Be more const correct
authorChris Lattner <sabre@nondot.org>
Mon, 26 Nov 2001 16:48:56 +0000 (16:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 26 Nov 2001 16:48:56 +0000 (16:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1332 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ConstantHandling.h
lib/VMCore/ConstantFold.h
lib/VMCore/ConstantFolding.h

index 9e9e760ea1f9fba57ec1380c0feaccc9ff537695..72632ee5df3e5dab1cd9ff1cebe31a1323355f92 100644 (file)
@@ -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;
index 9e9e760ea1f9fba57ec1380c0feaccc9ff537695..72632ee5df3e5dab1cd9ff1cebe31a1323355f92 100644 (file)
@@ -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;
index 9e9e760ea1f9fba57ec1380c0feaccc9ff537695..72632ee5df3e5dab1cd9ff1cebe31a1323355f92 100644 (file)
@@ -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;