[llvm-commits] CVS: llvm/include/llvm/ConstantHandling.h
Chris Lattner
lattner at cs.uiuc.edu
Thu Apr 17 14:23:01 PDT 2003
Changes in directory llvm/include/llvm:
ConstantHandling.h updated: 1.23 -> 1.24
---
Log message:
Don't force a ConstantPointer to be returned
---
Diffs of the changes:
Index: llvm/include/llvm/ConstantHandling.h
diff -u llvm/include/llvm/ConstantHandling.h:1.23 llvm/include/llvm/ConstantHandling.h:1.24
--- llvm/include/llvm/ConstantHandling.h:1.23 Mon Sep 2 20:04:11 2002
+++ llvm/include/llvm/ConstantHandling.h Thu Apr 17 14:22:47 2003
@@ -41,14 +41,12 @@
// Implement == and != directly...
//===----------------------------------------------------------------------===//
-inline ConstantBool *operator==(const Constant &V1,
- const Constant &V2) {
+inline ConstantBool *operator==(const Constant &V1, const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
return ConstantBool::get(&V1 == &V2);
}
-inline ConstantBool *operator!=(const Constant &V1,
- const Constant &V2) {
+inline ConstantBool *operator!=(const Constant &V1, const Constant &V2) {
return ConstantBool::get(&V1 != &V2);
}
@@ -89,8 +87,8 @@
virtual ConstantUInt *castToULong (const Constant *V) const = 0;
virtual ConstantFP *castToFloat (const Constant *V) const = 0;
virtual ConstantFP *castToDouble(const Constant *V) const = 0;
- virtual ConstantPointer *castToPointer(const Constant *V,
- const PointerType *Ty) const = 0;
+ virtual Constant *castToPointer(const Constant *V,
+ const PointerType *Ty) const = 0;
inline Constant *castTo(const Constant *V, const Type *Ty) const {
switch (Ty->getPrimitiveID()) {
@@ -117,7 +115,7 @@
static inline ConstRules *get(const Constant &V) {
return (ConstRules*)V.getType()->getOrCreateAnnotation(AID);
}
-private :
+private:
static Annotation *find(AnnotationID AID, const Annotable *Ty, void *);
ConstRules(const ConstRules &); // Do not implement
@@ -220,5 +218,6 @@
const Constant *V2);
Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2);
-
+Constant *ConstantFoldGetElementPtr(const Constant *C,
+ const std::vector<Constant*> &IdxList);
#endif
More information about the llvm-commits
mailing list