[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Nov 17 13:48:01 PST 2003


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.62 -> 1.63

---
Log message:

The ConstantPointer class is now gone.


---
Diffs of the changes:  (+10 -3)

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.62 llvm/lib/VMCore/Constants.cpp:1.63
--- llvm/lib/VMCore/Constants.cpp:1.62	Tue Nov 11 16:41:34 2003
+++ llvm/lib/VMCore/Constants.cpp	Mon Nov 17 13:47:21 2003
@@ -278,7 +278,7 @@
 }
 
 ConstantPointerRef::ConstantPointerRef(GlobalValue *GV)
-  : ConstantPointer(GV->getType()) {
+  : Constant(GV->getType()) {
   Operands.push_back(Use(GV, this));
 }
 
@@ -337,8 +337,15 @@
 bool ConstantStruct::classof(const Constant *CPV) {
   return isa<StructType>(CPV->getType()) && !isa<ConstantExpr>(CPV);
 }
-bool ConstantPointer::classof(const Constant *CPV) {
-  return (isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV));
+
+bool ConstantPointerNull::classof(const Constant *CPV) {
+  return isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV) &&
+         CPV->getNumOperands() == 0;
+}
+
+bool ConstantPointerRef::classof(const Constant *CPV) {
+  return isa<PointerType>(CPV->getType()) && !isa<ConstantExpr>(CPV) &&
+         CPV->getNumOperands() == 1;
 }
 
 





More information about the llvm-commits mailing list