Unify all constant evaluations that depend on register size
authorVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 29 Jul 2003 20:30:20 +0000 (20:30 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Tue, 29 Jul 2003 20:30:20 +0000 (20:30 +0000)
in TargetInstrInfo::ConvertConstantToIntType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7398 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetInstrInfo.h

index 8e8e0c08992ae70ccd58a4cb9cffc2b832c386c0..604aa59d3db81cfa174ff061f53c5d1e54b11417 100644 (file)
@@ -14,6 +14,7 @@
 class MachineInstr;
 class TargetMachine;
 class Value;
+class Type;
 class Instruction;
 class Constant;
 class Function;
@@ -300,6 +301,21 @@ public:
   // 
   virtual MachineOpCode getNOPOpCode() const { abort(); }
 
+  // Get the value of an integral constant in the form that must
+  // be put into the machine register.  The specified constant is interpreted
+  // as (i.e., converted if necessary to) the specified destination type.  The
+  // result is always returned as an uint64_t, since the representation of
+  // int64_t and uint64_t are identical.  The argument can be any known const.
+  // 
+  // isValidConstant is set to true if a valid constant was found.
+  // 
+  virtual uint64_t ConvertConstantToIntType(const TargetMachine &target,
+                                            const Value *V,
+                                            const Type *destType,
+                                            bool  &isValidConstant) const {
+    abort();
+  }
+
   // Create an instruction sequence to put the constant `val' into
   // the virtual register `dest'.  `val' may be a Constant or a
   // GlobalValue, viz., the constant address of a global variable or function.